Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitignore being ignored by Visual Studio?

I have a git project I work on using Visual Studio 2013 and Git.

I have noticed many, if not all, files listed in my .gitignore file are still being listed as pending changes in the Team Explorer window.

However, when doing a git status using bash, I don't see the files (as would be expected). Why is this happening, and more importantly, how can I have Visual Studio treat my .gitignore file the same as git bash?

.gitignore file:

GitIgnore file

Pending Changes Window (Team Explorer):

Pending Changes Window

like image 384
Adam Drewery Avatar asked Mar 18 '14 10:03

Adam Drewery


2 Answers

I was having the same problem with linked files. Team Explorer claimed I was adding the linked files, so I added them all to my .gitignore. git status was now clean, but Team Explorer continued to show these files as being added.

Right clicking the list of files in Team Explorer changes and selecting Undo seemed to work. The files themselves were not deleted, and they were removed from my list of changes.

Seems like Team Explorer just doesn't immediately pick up on changes to .gitignore. Hope this helps.

like image 144
Jim Skerritt Avatar answered Sep 18 '22 00:09

Jim Skerritt


To make Visual Studio 2013 include changes you made to the .gitignore file, delete the file ms-persist.xml in your solution's .git folder.

like image 37
Amged Rustom Avatar answered Sep 22 '22 00:09

Amged Rustom