Skip to content

Build deletes the .git folder #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MrSunshyne opened this issue Apr 13, 2018 · 4 comments
Closed

Build deletes the .git folder #2

MrSunshyne opened this issue Apr 13, 2018 · 4 comments

Comments

@MrSunshyne
Copy link

I followed the docs, that suggested git init inside the generate .vuepress/dist folder, but when I run a new build, I think it's deleting the entire dist folder, along with the .git folder which is there because i want to push to github pages.

Maybe exclude the .git folder when clearing dist would solve this ?

@mikhailbot
Copy link

mikhailbot commented Apr 14, 2018

Where in the docs was this suggested? Haven’t come across it in my reading and that doesn’t sound like the right thing to do either! The dist folder should typically just be used for outputting the generated content.

Edit: found it! I think that’s a bit of a hacky way to get it to work with GitHub pages. It even sounds like they’re saying to run it with CI as you know it’s going to get wiped. Honestly, save yourself the headache and give Netlify a go for deployment. It’s super easy and won’t have this issue as it’s doing the building on their side.

@yyx990803
Copy link
Member

This is intended. You simply init a new repo and force push on each deploy.

@vhanla
Copy link

vhanla commented May 18, 2018

Copy/move .git directory before running vuepress build and restore it after.

Maybe this script will help you, but it is a PowerShell script.

@SeaDude
Copy link

SeaDude commented Jan 14, 2019

Some of us are deploying to intranet. Therefore cloud resources such as Netlify, etc aren't an easy option. We have an Enterprise Github instance, so I'll try @vhanla 's suggestion.
Thank you.

franktip added a commit to ProfilingPromisesBenchmarks/vuepress that referenced this issue Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants