I have two branches, one called "gh-pages" and the other "master" branch. Both are having separate folders like "node_modules", but they are completely different. And they are untracked!
So when checking out e.g. the "gh-pages" branch as follows
git checkout gh-pages
I need a way to specify that Git should not just remove (but save) all tracked, but also all untracked files and folders (like the "node_modules" folder) from the "master" branch. And then load all tracked files and folders from the "gh-pages" branch and as well as all untracked files and folders.
Is there a simple way or do I really need to remove untracked files and folders for each checkout so that the two do not come into the cross?