I have a file called \"style.css\" and git is not detecting it. It doesn\'t detect it if I delete it either, but it does detect if I change the name of the file. But I need
some want to add an empty folder for some reasons If the content of the folder is empty, then there is no reason for git to mention it.
A convention says that you might want to add a file .keep
to it. which could also any other file.
see here or here
If your project is a maven project, check if you changed the src file or the target file. That's what I did recently. With the file path reference being too long, I failed to notice the 'target' in the path. All good after 1 hr of agony.
Another reason to this problem may be the .gitignore_global
file.
In my case, it was automatically produced by Sourcetree
app while i was ignoring file. It was in my user path(/Users/user_name/.gitignore_global
).
I encountered another cause for this. Probably very rare circumstances.
I copied my entire repository to another folder to work on it. Changes I made to a submodule just weren't being detected by git. Turned out that the .git file in the submodule folder contained an absolute file reference to the original copy. As soon as I corrected the file reference to point to my working copy all was well.