Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All new files I add are ignored by git

Tags:

git

smartgit

I have a project that uses git for its source control and I use SmartGit as the GUI.

Recently when adding new files to the project they're being ignored by git (this has only started happening in the last week or so before that it was fine).

So if I add a new file into the hierarchy it doesn't show up in the SmartGit GUI.

If I type git status into git then nothing comes up.

If I type git status --ignored into git then it lists the file I had added.

If I type git add -f filename then it adds the file and it shows up in SmartGit.

I've checked my .gitignore file and it has nothing unusual in it.

I don't have a global .gitignore. I do have an exclude file but it is referencing a subdirectory and had been working fine long before this problem showed up.

Any ideas why git should think all new files are ignored even when they aren't referenced in a .gitignore file?

like image 461
Mixit Deejay Avatar asked Sep 01 '25 10:09

Mixit Deejay


1 Answers

I don't know how and when , but in my case I had the whole directory added to .gitignore. Use:

git check-ignore -v path

To check for ignored files and directories. More info at: Git is ignoring files that aren't in gitignore

like image 179
tec Avatar answered Sep 02 '25 23:09

tec