2

I have a number .net core solutions in Visual studio 2017 and I've observed that on this particular machine (Windows 10 in Parallels on a MacBook pro) whenever I add new files to my project (or split a class into a separate file) git doesn't see it as an added file.

enter image description here

While preparing this question, I also observed that files that I manually add to these folders are also ignored.

I have to right click the file and select Add ignored file to Source Control. It's a real drag because I often only find out a file is missing after the build fails on VSTS. The source control indicator icons don't show up consistently, so it's difficult to know what's source controlled.

enter image description here

I also use Sourcetree, and neither this nor git add -u detects these files until I right click the file and add it from Visual studio solution manager.

enter image description here

I've searched for index.lock files, and tried to follow the other troubleshooting tips here: Visual Studio: Git Team Explorer does not show any changes but to no avail.

My git ignore file only contains:

**/.vs
**/obj
**/bin

Edit

I started looking at this question and found that the problem is restricted to my project that ends with .Lib, files added to my other project folders are correctly detected! Is this a known issue?

  • Am I missing a hidden ignore file somewhere?
  • Is this a known issue?
  • What else would cause git to ignore files?
reckface
  • 5,678
  • 4
  • 36
  • 62

1 Answers1

2

Well, it was the .lib folder name! I found a file called \\Mac\Home\Documents\gitignore_global.txt, removed the entry for *.lib and everything works as expected.

Yeah, I do feel silly, but the process of posting the question resulted in the solution.

reckface
  • 5,678
  • 4
  • 36
  • 62
  • Happened something similar to me. Someone added a folder to the .gitignore and it was excluding all new files on that folder. I suppose Visual Studio has some Add Ignore feature that makes this easy. Your case helped me find my problem. – Pablo Rausch Jul 30 '18 at 14:44