Search code examples
macosgitbranchfinder

Git - folder after changing branch


why are some folders(which are not in the repo) are still in my project-folder when I change the branch?

I already tried "git clean" but the folder are still there...


Solution

  • Git doesn't track folders by itself, hence it will not clean them either.

    This situation often happens to me when some folder's contents is added to .gitignore in one branch, but when you switch to another branch that doesn't have them ignored, you will still get the content but this time showing up in the git status.

    I would not bother with the empty directories like this unless they impede you in some way.