我只是使用本教程学习 git 版本控制:
http://net.tutsplus.com/tutorials/other/easy-version-control-with-git/
现在我做了 2-3 次提交,然后切换到另一个分支。然后我又做了 2-3 次提交。
gitk -all
但我仍然在or中看到一条简单的直线git log --graph
。
可能出了什么问题?
user@comp:~/Documents/trygit2$ git add .
user@comp:~/Documents/trygit2$ git commit -m 'first commit'
[master (root-commit) d525eb9] first commit
0 files changed
create mode 100644 file1
user@comp:~/Documents/trygit2$ git add .
user@comp:~/Documents/trygit2$ git commit -m 'second commit'
[master 5fe0bba] second commit
0 files changed
create mode 100644 file2
user@comp:~/Documents/trygit2$ git branch branch1
user@comp:~/Documents/trygit2$ git checkout branch1
Switched to branch 'branch1'
user@comp:~/Documents/trygit2$ git add .
user@comp:~/Documents/trygit2$ git commit -m 'branch commit1'
[branch1 84e162e] branch commit1
0 files changed
create mode 100644 branchfile
user@comp:~/Documents/trygit2$ git add .
user@comp:~/Documents/trygit2$ git commit -m 'branch commit 2'
[branch1 bb7a619] branch commit 2
0 files changed
create mode 100644 branchfile2
user@comp:~/Documents/trygit2$ git status
# On branch branch1
nothing to commit (working directory clean)
user@comp:~/Documents/trygit2$ git log --graph
* commit bb7a619990925782c37921e80c3aaf8310530de2
| Author: = <=>
| Date: Fri May 17 16:33:58 2013 +0530
|
| branch commit 2
|
* commit 84e162e186dc1a7d51ac48eaf3d05748178da803
| Author: = <=>
| Date: Fri May 17 16:33:42 2013 +0530
|
| branch commit1
|
* commit 5fe0bbaf72b3db9f456c5687efd425b0dac28466
| Author: = <=>
| Date: Fri May 17 16:32:50 2013 +0530
|
| second commit
|
* commit d525eb935deb4899293db64bdbc350add21bc943
Author: = <=>
Date: Fri May 17 16:32:28 2013 +0530
first commit