2

Using msysgit on windows: git version 1.8.5.2.msysgit.0

I have a folder tree with hundreds of small projects like this:

Root
|--Project1
    |--xx/xx/xx/xx/obj
|--Project2
    |--yy/yy/yy/yy/obj
|--Project3
    |--zz/zz/zz/zz/obj

I have the entry obj/ in my .gitignore file

One single obj folder is not being ignored and always appears in the untracked files list. I have tried commands such as:

git rm -r --cached Project3\zz\zz\zz\zz\obj

but it just says pathspec did not match any files - of course it would as the files are not tracked in my git repository.. they're just in the local folder.

How can I ignore this folder?

Wolf
  • 4,254
  • 1
  • 21
  • 30
David J
  • 733
  • 5
  • 19

1 Answers1

0

Try again with a recent (2018, 4 years later) version of Git.

If there is a file in that obj/, you can check if it is ignored or not with:

git check-ignore -v --  Project3\zz\zz\zz\zz\obj\aFile

Check also if one of the parent folder is not a gitlink (root entry for a nested Git repo, or a submodule)

git ls-tree HEAD Project3
git ls-tree HEAD Project3/zz
...
git ls-tree HEAD Project3/zz/zz/zz/zz/obj

If any of those commands yields 160000, that would mean an entry to be removed as I did here.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250