0

I am building a node.js project and I have a gh-pages branch for the github website. I have a mockoups folder in that branch that I've included in the .gitignore file, because I don't want it on github. Whenever I checkout to another branch the folder gets deleted.

How do I keep the folder but not commit it to github?

Nir Kogman
  • 131
  • 2
  • 8
  • Possible duplicate of [Git is deleting an ignored file when i switch branches](https://stackoverflow.com/questions/2691618/git-is-deleting-an-ignored-file-when-i-switch-branches) – Adam Apr 05 '19 at 11:06

2 Answers2

0

If you have it in the .gitignore in the other branches I would suggest clearing cache Clear git local cache

0

Only untracked data is left untouched on checkout.

Make sure your folders were not already tacked when you added them to your .gitignore.

git rm --cached -r afolder/

Then try and checkout another branch.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250