【问题标题】:Why isn't " $ git log --graph " working为什么“ $ git log --graph ”不起作用
【发布时间】:2012-02-22 20:14:48
【问题描述】:

我最近尝试在 git 中使用分支,但是无论我做什么它们都可以正常工作,但我无法显示我的分支和合并图。我已经为 ubuntu 和 gitk 尝试过 Giggle,但它们都没有像这个 nettuts+ 教程中所示的那样工作 http://net.tutsplus.com/tutorials/other/easy-version-control-with-git/

我输入那个

$ git log --graph #Sorry my sreenshot is missing h at the end

但不是这个...

...我明白了...

如果能得到快速回复,我会很高兴...

这是 ' $ gitk --all ' 的输出

【问题讨论】:

  • 您希望它看起来如何?你确定那里有分店吗?
  • 您目前已签出BigIdea。也许尝试git log --graph master 来查看master 的历史(假设您甚至将BigIdea 合并到master)。
  • @TimBielawa 是的,我在这里有一个分支,因为结帐有效,合并也有效,但它仍然只显示一行中的所有分支。我将添加 'gitk -all' 输出的屏幕截图...
  • @webdos 由于 git 的工作方式,您可能没有得到包含许多不同历史路径的图表。为了简单起见,git 会尽可能快进(ff)合并。如果历史记录保持不变,则 ff 合并只会更改 ref 指向的对象。这可能就是为什么你看到你是什么。尝试从 master git checkout -b testBranch 创建一个分支,进行一些提交,检查 master,git merge --no-ff testBranch,然后是 gitk --all

标签: linux git ubuntu graph logging


【解决方案1】:

您可能正在寻找git log --graph --all,同样是gitk,我的shell 中有一个别名:

alias gk='gitk --all'

就是为了这个目的。

来自git help log

--all
    Pretend as if all the refs in refs/ are listed on the command line as <commit>.

所以如果你有分支abc,就好像你告诉git以这种方式显示日志和图表:

git log --graph a b c

本质上,git log 允许您列出您可以在希望查看日志的内容中引用的任何对象。你甚至可以在一个文件上使用它,或者多个文件文件....

$ git log --oneline python-taboot.spec     
c96d546 Straighten out the Makefile. Hey -- make rpm works now! Update a lot of docs. Fixes #34 - Taboot 'edit' mode should hint at the file type and give instructi
ea0d60b Version bumpskies to 0.4.0-1beta
a95cfbf Automatic commit of package [python-taboot] release [0.3.2-1].
d9e3ca6 Make python-argparse a Requires for el6 as well
ea7ed54 Automatic commit of package [python-taboot] release [0.3.1-1].
69eaea9 Add conditional Requires on python-argparse. Update README and release notes.
...

等等……

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-16
    • 1970-01-01
    • 1970-01-01
    • 2011-03-12
    • 2017-02-10
    • 2019-12-30
    • 2015-10-28
    • 2011-06-11
    相关资源
    最近更新 更多