I have a very old git repository (about six years old) and noticed that I wasn't seeing changes I'd made to a file in my git status
output.
I ran the command on the specific file in question:
$ git status Data/schema.sql
$
and got no output! This file has been in the repo since the beginning. Additionally, if I checkout the repo to another directory, the file (strangely enough) appears there.
I saw the same with git diff Data/schema.sql
and git log Data/schema.sql
.
Normally, when something like this happens, it's a gitignore
problem. But even removing my .gitignore
file caused no change in this behavior.
What could cause this behavior?
This "symptom" has two possible "diagnoses":
git ls-files
Search for paths with different capitalizations:
some/path/foo
Some/path/bar
git mv -f Some/path/* some/path/
It's important to move all files (/*
) to the renamed path. Now they will all have a single path.
There may be a situation when some/path
has several files with it, tracked with different letter cases in the path. For such files providing an "incorrect" path to git log
or git status
results in abscense of some commits in the log output.
This bug is reproduceable with git mv -f <path/file> <PATH/file>
on Git 1.9.5 and maybe on newer versions (will check later).
git log Some/path/foo
The log will not contain some commits made before the git mv -f some/path/bar Some/path/bar
was executed.
skip-worktree
or assume-unchanged bit
Thanks to @Zeeker for this assumption.
git ls-files -v | grep -E '^(S|[a-z])'
For additional information take a look at the git ls-files
documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With