Chris Simmons
Chris Simmons

Reputation: 7266

Where does the default Visual Studio 2013 .gitignore reside?

So awhile ago I noticed that Visual Studio was automatically creating a .gitignore file whenever I created a solution inside an existing local git repo folder. Great. However, I noticed it was ignoring some NCrunch files (*.ncrunchsolution and *.ncrunchproject) that should really be in source control. So I decided to dig in to fix it. The problem here is I don't know where it's getting this default file from. I see that it's basically an older version of VisualStudio.gitignore at the gitignore GitHub project (which just so happened to fix the NCrunch issue back in April).

Where can I find or configure the source for the .gitignore that the Visual Studio git provider automatically puts into a git repo?

(Edit: I looked at the ignore topic what I assume are the official docs for the VS 2013 git functionality, but it doesn't help to find a system-wide setting for this. It simply mentions "the default .gitignore file provided by Visual Studio" without any mention of how to modify this file.)

Upvotes: 7

Views: 560

Answers (1)

jessehouwing
jessehouwing

Reputation: 114651

The default .GitIgnore is an Embedded Resource of

// Assembly Microsoft.TeamFoundation.Git.CoreServices, Version 12.0.0.0

Location: C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Microsoft.TeamFoundation.Git.CoreServices.dll 
Name: Microsoft.TeamFoundation.Git.CoreServices, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 
Type: Library 

// public resource Microsoft.TeamFoundation.Git.CoreServices.Resources.VS.gitignore

So I don't think you can update it.

It was recently updated with Visual Studio 2013u2, but it seems the ncrunch files are still part of the default ignores. I suspect that a newer version will be included in 2013u3 or maybe as an interim update. Until then, you'll need to manually patch your gitignore files or create a default gitignore in your userprofile.

Upvotes: 4

Related Questions