问题描述
我见过一些书籍和文章有一些非常漂亮的git分支和提交图。如何创建高质量的git历史打印图像?解答方案
我见过一些书籍和文章有一些非常漂亮的git分支和提交图。如何创建高质量的git历史打印图像?解答方案
比它应得的。最初发布是因为我认为图表看起来不错,可以在Illustrator中为出版物绘制 - 而且没有更好的解决方案。但是现在存在更多适用于此Q的答案,例如' s, 或的!更新2:我已将此答案的改进版发布到 lg3
,它显示了作者和提交者信息,所以你应该检查它。留下这个答案的历史(&代表,我承认)的理由,但我真的很想删除它。
〜/ .gitconfig
文件中输入两个别名: git lg
/ git lg1
看起来像这样: >
和 git lg2
看起来像这样:
I've seen some books and articles have some really pretty looking graphs of git branches and commits. How can I make high-quality printable images of git history?
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. But there now exists much more applicable answers to this Q, such as fracz's, Jubobs', or 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. That version includes lg3
, which shows both the author and committer info, so you really should check it out. 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:
[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:
and git lg2
looks like this:
这篇关于漂亮的git分支图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!