Update: This answer has gotten far more attention than it deserves.
(更新:这个答案得到了比应有的更多的关注。)
It was originally posted because I think the graphs look nice and they could be drawn-over in Illustrator for a publication– and there was no better solution. (它最初发布是因为我认为图形看起来不错,它们可以在Illustrator中用于出版物 - 并且没有更好的解决方案。)
But there now exists much more applicable answers to this Q, such as fracz 's, Jubobs ', or Harry Lee 's! (但是现在存在更多适用于这个Q的答案,例如fracz 's, Jubobs '或Harry Lee 's!)
Please go upvote those!! (请尽快投票!)
Update 2: I've posted an improved version of this answer to the Visualizing branch topology in git question, since it's far more appropriate there.
(更新2:我已经在git问题中向可视化分支拓扑发布了这个答案的改进版本,因为它在那里更合适。)
That version includes lg3
, which shows both the author and committer info, so you really should check it out. (该版本包含 lg3
,它显示作者和提交者信息,所以你真的应该检查出来。)
Leaving this answer for historical (& rep, I'll admit) reasons, though I'm really tempted to just delete it. (留下这个答案的历史(和代表,我会承认)的原因,虽然我真的很想删除它。)
2¢ : I have two aliases I normally throw in my ~/.gitconfig
file:
(2¢ :我通常在~/.gitconfig
文件中抛出两个别名:)
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
git lg
/ git lg1
looks like this:
(git lg
/ git lg1
看起来像这样:)
and git lg2
looks like this:
(和git lg2
看起来像这样:)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…