我对 git 非常陌生,刚刚开始使用它。这就是我所做的:
john@john:~/workspace/git-test/tmp$ git log --pretty=oneline
7d6bebed1d7bcfd916dd930303b7e95c974ad354 xThis will be amended
2c32b4519c8c06e6e6ae381a67d6824a33a512ce another emty file
cd34e9e0c40f18984f66e58bd1650c98f8c3aedf Merge branch 'master' of /home/john/workspace/git-test/../tmp
408020f5e0ffda578e8690a487c80f3c22ea2804 Empty file added
4b80be932603083d9712aa4329812d045d22eafa added emty file
7ab109a5fe405dcb9f52424a8b27790b51ff43bf Testing .gitignore?
92ba23c892102e8162b700a43548567cefe7183a Initial setup
比我尝试切换到以前的提交:
john@john:~/workspace/git-test/tmp$ git checkout -b issue01 408020f
Switched to a new branch 'issue01'
并检查日志:
john@john:~/workspace/git-test/tmp$ git log --pretty=oneline
408020f5e0ffda578e8690a487c80f3c22ea2804 Empty file added
7ab109a5fe405dcb9f52424a8b27790b51ff43bf Testing .gitignore?
92ba23c892102e8162b700a43548567cefe7183a Initial setup
问题:
这个提交在哪里 4b80be932603083d9712aa4329812d045d22eafa added emty file
?我很确定我做错了什么,只是不知道在哪里检查它......
更新
john@john:~/workspace/git-test/tmp$ git log --pretty=oneline --graph
* 408020f5e0ffda578e8690a487c80f3c22ea2804 Empty file added
* 7ab109a5fe405dcb9f52424a8b27790b51ff43bf Testing .gitignore?
* 92ba23c892102e8162b700a43548567cefe7183a Initial setup
john@john:~/workspace/git-test/tmp$ git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 4 commits.
john@john:~/workspace/git-test/tmp$ git log --pretty=oneline --graph
* 7d6bebed1d7bcfd916dd930303b7e95c974ad354 xThis will be amended
* 2c32b4519c8c06e6e6ae381a67d6824a33a512ce another emty file
* cd34e9e0c40f18984f66e58bd1650c98f8c3aedf Merge branch 'master' of /home/john/workspace/git-t
|\
| * 4b80be932603083d9712aa4329812d045d22eafa added emty file
* | 408020f5e0ffda578e8690a487c80f3c22ea2804 Empty file added
|/
* 7ab109a5fe405dcb9f52424a8b27790b51ff43bf Testing .gitignore?
* 92ba23c892102e8162b700a43548567cefe7183a Initial setup