Git:在git visual log上看不到提交

时间:2012-11-26 14:18:50

标签: git gitk smartgit

我一直在学习git,通过玩命令和阅读东西。这是我能看到的,我期待的图表与我在右边所做的相似。

这令人困惑,树应该怎么样,因为我看不到我的其他提交? 为什么我看不到我的提交?

enter image description here

这是我做的:

  • c08b318委托一个名为README.md的文件并推送到主人
  • 创建了一个名为somethingnew
  • 的分支
  • 643f1b0somethingnew分支上修改了README.md,然后提交修改后的文件
  • checkout master branch做了2次提交1029180ad34cc2
  • 然后移动结帐somethingnew创建了一个名为NewFile.txt的新文件并提交了文件a526cd9

2 个答案:

答案 0 :(得分:2)

尝试gitk --all,它将显示存储库中的所有分支和标记。

默认情况下,你得到的只是当前分支的祖先。

答案 1 :(得分: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 HEAD@{0}: checkout: moving from master to somethingnew
f1aa76b HEAD@{1}: checkout: moving from somethingnew to master
187cd79 HEAD@{2}: checkout: moving from master to somethingnew
f1aa76b HEAD@{3}: checkout: moving from somethingnew to master
187cd79 HEAD@{4}: merge master: Merge made by the 'recursive' strategy.
a8fe187 HEAD@{5}: checkout: moving from master to somethingnew
f1aa76b HEAD@{6}: commit: Contents added to FileA
3c5a4fc HEAD@{7}: checkout: moving from somethingnew to master
a8fe187 HEAD@{8}: commit: Added FileB on branch somethingnew
3c5a4fc HEAD@{9}: checkout: moving from master to somethingnew
3c5a4fc HEAD@{10}: commit (initial): Initial commit on master
spiders-iMac:git-practice david$