I make an arbitrary change to a file within my git working directory.
git status
does not recognized that the file has changed.
git add /path
You check your global git ignore file?
git config --global --get-all core.excludesfile
git config --system --get-all core.excludesfile
If either of those return a file as their value, look in that file.
There are two general reasons why Git will ignore a file: gitignore and submodules.
To be more specific, the following conditions will cause Git to ignore a file when 'git add
' is invoked:
$GIT_DIR/exclude
..gitignore
file inside the repo..gitignore
file (specified by 'git config --global core.excludesfile
').More info can be found in another SO question:
Unable to track files within Git submodules
Check each parent directory from the file in question to the project root for .gitignore files.
Some projects use several .gitignore files, each in its own directory, instead of a single .gitignore in the root.
Are you sure that your file is not excluded by some of the .gitignore files in parent directories?
After you did git add, did you do a commit so it's actually in the repo and can be compared to the (changed) working copy?
if your file is in the 'Changes to be committed' bucket then git already recognized the change and is going to commit it! Its in the index already. Otherwise it would be in the 'Changed but not updated' bucket.
:)
Hope this helps/