If you need ready-to-use .gitignore file for your Visual Studio/C# projects, here it is:
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
This file is a part of gitignore project which accumulates .gitignore for different languages/technologies.