Objective: You have multiple Visual Studio projects (using the same technology stack) under a single git repository and you need to manually add a .gitignore file.
Instead of copy/pasting an existing .gitignore file, let Visual Studio generate it for you.
2 Steps to Add the .gitignore File via Visual Studio
- Inside Visual Studio, open your solution and click the tab “Team Explorer”
- Then click “Add” under Ignore & Attributes Files -> Ignore File
This will add the .gitignore file in your root git repository folder. So you should not need to repeat the projects for other Visual Studio projects in the same folder (provided they are all using the same technology stack).