Yes, you can add the .vs folder to .gitignore - in fact you should do this at the beginning.
Also - when creating a new repository on GitHub, you can use the predefined .gitignore file ... in your case it can be "Visual Studio" (included with .vs and much more):

For myself, I always add extra lines to ignore the Bower and NPM packages - they are automatically restored, so I see no reason to keep them in the repository (and there are really a lot of files) - if you do not want to save the change history in these libraries - but your choice :
BTW: .vs is the working folder of Visual Studio and is not required to store the solution / project - you can delete it when VS turns off, and after that VS will recreate it during lunch of any solution - of course, you will lose your working IDE configuration, but not worry, it doesnβt hurt.
source share