Working on a local Git (cloned) repository, I have created a branch and placed .gitignore
file within it to exclude few directories from git commit
. It works just fine, but after switching to a different branch, those directories (the excluded ones) appear in it (on the branch which does not include those directories).
Is it a normal Git behavior? If so, what is the best practice to avoid the issue above?