Vuepress: Build deletes the .git folder

Created on 14 Apr 2018  路  4Comments  路  Source: vuejs/vuepress

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 ?

All 4 comments

Where in the docs was this suggested? Haven鈥檛 come across it in my reading and that doesn鈥檛 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鈥檚 a bit of a hacky way to get it to work with GitHub pages. It even sounds like they鈥檙e saying to run it with CI as you know it鈥檚 going to get wiped. Honestly, save yourself the headache and give Netlify a go for deployment. It鈥檚 super easy and won鈥檛 have this issue as it鈥檚 doing the building on their side.

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

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaodahong picture shaodahong  路  3Comments

higuoxing picture higuoxing  路  3Comments

herrbischoff picture herrbischoff  路  3Comments

ynnelson picture ynnelson  路  3Comments

FadySamirSadek picture FadySamirSadek  路  3Comments