I got the impression that any ignored files are irrelevant in a git repo. But I ran into the situation below:
The .vs folder is listed in .gitignore:
$ cat .gitignore
.git/
.vs/
bin/
My Project/
obj/
packages/
App_Data/
But when I tried to switch to another branch, a file in .vs folder is blocking:
$ git checkout test
error: Your local changes to the following files would be overwritten by checkout:
.vs/myproject/v16/.suo
Please commit your changes or stash them before you switch branches.
Aborting
And git will complain if I tried to add this file:
$ git add .vs/myproject/v16/.suo
The following paths are ignored by one of your .gitignore files:
.vs
hint: Use -f if you really want to add them.
hint: Turn this message off by running
hint: "git config advice.addIgnoredFile false"
And advise is appreciated.