2012-11-26 48 views
0

我一直在通過玩命令和閱讀東西來學習git。這是我所能看到的,我期待着一張類似於我在右側做的圖表。Git:在git可視化日誌上看不到提交

這是令人困惑的,樹應該如何看起來像因爲我看不到其他提交? 爲什麼我看不到我的提交?

enter image description here

這裏是我做過什麼:

  • c08b318 COMMITED一個名爲README.md推掌握
  • 創建一個分支叫somethingnew
  • 643f1b0修改README.md上的文件somethingnew分支然後提交修改後的文件
  • checkout master b牧場做了2款1029180ad34cc2
  • 然後移動結賬somethingnew創建了一個名爲NewFile.txt新文件和COMMITED文件a526cd9
+0

這聽起來像你從'c08b318'創建'somethingnew'。如果你只是推着這個可以克隆它的人,那麼弄清楚發生了什麼可能會更容易一些。 –

回答

2

嘗試gitk --all,它會顯示存儲庫中的所有分支和標記。

默認情況下,您得到的只是當前分支的血統。

+0

謝謝,我現在覺得很愚蠢。 http://i.imgur.com/s46eT.png –

0

Git的提交日誌是當地的分支,所以直到合併發生在這裏 - 你在您的可視化日誌中不會看到該提交,除非您已將該分支簽出。

spiders-iMac:git-practice david$ git checkout master 
spiders-iMac:git-practice david$ git log --oneline 
f1aa76b Contents added to FileA 
3c5a4fc Initial commit on master 


spiders-iMac:git-practice david$ git checkout somethingnew 
Switched to branch 'somethingnew' 


spiders-iMac:git-practice david$ git log --oneline 
187cd79 Merge branch 'master' into somethingnew 
f1aa76b Contents added to FileA 
a8fe187 Added FileB on branch somethingnew 
3c5a4fc Initial commit on master 


spiders-iMac:git-practice david$ git reflog 
187cd79 [email protected]{0}: checkout: moving from master to somethingnew 
f1aa76b [email protected]{1}: checkout: moving from somethingnew to master 
187cd79 [email protected]{2}: checkout: moving from master to somethingnew 
f1aa76b [email protected]{3}: checkout: moving from somethingnew to master 
187cd79 [email protected]{4}: merge master: Merge made by the 'recursive' strategy. 
a8fe187 [email protected]{5}: checkout: moving from master to somethingnew 
f1aa76b [email protected]{6}: commit: Contents added to FileA 
3c5a4fc [email protected]{7}: checkout: moving from somethingnew to master 
a8fe187 [email protected]{8}: commit: Added FileB on branch somethingnew 
3c5a4fc [email protected]{9}: checkout: moving from master to somethingnew 
3c5a4fc [email protected]{10}: commit (initial): Initial commit on master 
spiders-iMac:git-practice david$