问题
I discovered this odd issue while looking for a lost change.
I typed in:
git log httpd.conf
I am getting a bunch of commit hashes as expected, but not the one I did.
When I type in:
git log
I see the commit I made. When I run:
git show <hash>
I see my edits to httpd.conf
Can anyone explain what may have happened? If there is more information needed to discover the root please let me know.
回答1:
From git docs (http://git-scm.com/docs/git-log):
Default mode - simplifies the history to the simplest history explaining the final state of the tree. Simplest because it prunes some side branches if the end result is the same (i.e. merging branches with the same content)
Try using:
git log --full-history
(Same as the default mode, but does not prune some history.)
来源:https://stackoverflow.com/questions/28303805/git-log-filename-doesnt-show-commit-but-git-log-shows-commit-that-edited-the