2

So this is kind of weird. I have files within a folder, within the main directory, and Git doesn't see them. So when I git status I don't see my dear updated files.

I don't have a .gitignore, I've tried git config core.excludesfile but it rendered no output, I've checked REPO/.git/config and REPO/.git/info/exclude, nothing in there, git add -f was no hero, git check-ignore is not a Git command (might be my Git version).

I cloned my repo locally but still the same problem applied to the new repo. I've checked these answers: Untracked files not shown in git status, Git is ignoring files that aren't in .gitignore, Git is not detecting a file and is not in .gitignore, Show ignored files in git but no solution provided in there worked for me.

But if I rename the folder then git status output it. So does anybody know where I should look for ? I'm not even asking why there's so many ways to ignore files because I know I'll end up with more questions than answers, but hell Git you're supposed to make my life easier !

Community
  • 1
  • 1
theFreedomBanana
  • 1,922
  • 15
  • 25

2 Answers2

8

Check:

  • ~/.gitignore
  • The .gitignore within the directory itself and any parent directories (not just the repository root)
  • ~/.config/git/ignore
  • ~/.gitconfig for an extra excludesFile entry
  • ~/.config/git/config, again looking for an excludesFile entry
  • .git/info/exclude
  • .git/config, again for excludesFile
  • /etc/gitconfig, again for excludesFile

You should also look at the output of git status --ignored to make sure that ignoring is what's going on.

Borealid
  • 86,367
  • 8
  • 101
  • 120
  • I've checked everything on what @Borealid listed but I didn't my folder/files listed ignored anywhere. I don't know if this is normal but I have no `.gitignore` in any parent directory of my project folder (including user root), no git folder in '~/.config', no `gitconfig` in `/etc`. However `git status --ignored` outputs nothing so as you pointed out it might not be a file ignored problem. – theFreedomBanana Oct 04 '15 at 10:32
  • 2
    @theFreedomBanana If `git status --ignored` doesn't show them *in a fresh clone*, then the problem has nothing to do with ignore rules. – Borealid Oct 04 '15 at 21:26
  • 1
    One more spot to check in `~/.gitignore_global`. Found my issue there. – Geo Dec 17 '15 at 23:19
1

This is a long shot, but, when you initially cloned your repo locally: Did you first create a directory and then cd into and then clone your repo into it, inadvertently creating a nested directory of the same name?

something like myApp/myApp/contentStuff

Then, to correct your mistake, you dumped the nested folder out of the parent and deleted the original parent? If yes to all of this, this messed up your git settings and prevented proper file tracking. I'm not a git expert, so the only way I know how to fix it is to recreate the original parent folder — naming it the same as before — and then dropping your git dir back into it. I know this issue is stale but maybe this will help someone else.

Cam
  • 197
  • 1
  • 7