Open Visual Studio and the solution needing an ignore file.
If you don’t see the Git menu in Visual Studio see the previous link for information on enabling the feature preview. This post will cover adding a Git ignore file to an existing solution using Visual Studio’s new Git experience. Fast forward to today and Visual Studio has a new Git Experience in preview which alters this process.
Though it is an old post, it holds up through the current version of Visual Studio. A few years ago I wrote a post covering how to Add Git Ignore to an existing Visual Studio Project which was using Visual Studio 2015 I believe.