Why does Git ignore the .vs directory?

时间:2015-07-28 16:23:58

标签: git visual-studio-2015

I have installed Visual Studio 2015, and before that I already had Git for Windows 1.9.5 and TortoiseGit 1.8.14.3.

Git ignores the hidden .vs directory in my source project. It even ignores it when it doesn't have the hidden attribute. While that's totally fine, I'd like to understand why it is ignored. It's not in my .gitignore file and I can't find a global ignore file either. Is that some kind of Git-builtin behaviour to ignore .vs directories? It never ignored the root *.suo files of former Visual Studio versions so I assume, and expect, that I need to handle that myself.

Might Git under some circumstances stop ignoring that directory at some point, so should I add it to my .gitignore file anyway?

1 个答案:

答案 0 :(得分:5)

Git will only include a directory if it has files to include. (git's internal data structure has no way to represent an empty directory)

If you add a non-ignored file to that directory, it will show up.