This is more goofiness between Git and Microsoft that requires some new custom circus trick to work....but here it is!
- Make sure your Git repo has a .git and .gitignore folder and file.
- In the .gitignore file add the following lines with your Git project name to make sure your .vs folder is ignored:
.vs/
{yourgitprojectname}/.vs
- Delete the ".vs" folder. Be sure to leave the ".git folder intact. Realize when you do this you remove the Git-to-Visual Studio project connection, but your Git repo still exists.
- In the lower right corner of Visual Studio look for your Git repo again and click it. It should rebuild your .vs folder again. But now ".vs" will be ignored.
- Push your code to Azure, GitHub, etc. again. The ".vs" folder should not appear in your online repo and should be hidden. I use GitHub and it worked up there, so test your Azure.