请问有人能帮我理解这里正在发生的事情吗?
我用 git log --oneline
开始,输出结果如下:
4df9421 (HEAD, master) moved some aliases around
d3810e4 (origin/master) some terminal color changes
a7182d3 git colors, ignores, etc.
995fe8c added gitconfig, moved some personal stuff out of the public repo
8a100b7 misc unimportant updates
55d2c08 added a fix to "open with", refactored
7ec7d83 Removed some vim colors; added a couple searching aliases
330c7fc Minor updates
44e80a1 Added vim files
48537c6 Fixed some formatting problems
14933a2 Initial Commit
然后我执行git reset --hard 330c7fc
,这将把日志还原到:
330c7fc (HEAD, master) Minor updates
44e80a1 Added vim files
48537c6 Fixed some formatting problems
14933a2 Initial Commit
到目前为止一切都很好,但(现在我已经重置了),当我运行 git log --oneline --all
命令时,我得到以下输出:
d3810e4 (origin/master) some terminal color changes
a7182d3 git colors, ignores, etc.
995fe8c added gitconfig, moved some personal stuff out of the public repo
8a100b7 misc unimportant updates
55d2c08 added a fix to "open with", refactored
7ec7d83 Removed some vim colors; added a couple searching aliases
330c7fc (HEAD, master) Minor updates
44e80a1 Added vim files
48537c6 Fixed some formatting problems
14933a2 Initial Commit
请注意,最新的条目“4df9421移动了一些别名”在此列表中缺失。
我的理解是,--all
选项应该显示所有提交记录。为什么我回滚到早期的提交后最新的记录消失了?
谢谢。
git log --all
中仍然可见。 - VonCgit log
的--walk-reflogs
选项。(例如,https://dev59.com/gnRB5IYBdhLWcg3wAjXR#746790) - VonC