本文介绍了漂亮的git分支图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过一些书籍和文章有一些非常漂亮的git分支和提交图。如何创建高质量的git历史打印图像?解答方案

比它应得的。最初发布是因为我认为图表看起来不错,可以在Illustrator中为出版物绘制 - 而且没有更好的解决方案。但是现在存在更多适用于此Q的答案,例如' s, 或的!更新2:我已将此答案的改进版发布到 lg3 ,它显示了作者和提交者信息,所以你应该检查它。留下这个答案的历史(&代表,我承认)的理由,但我真的很想删除它。

2¢:我通常在我的〜/ .gitconfig 文件中输入两个别名:



<$ p (重新设定)%c(粗体蓝色)%h%C(重新设定)
$ lg1 = log --graph --abbrev-commit --decorate --format = format: - %C(淡绿色) - %C(淡绿色) - %C(复位)%C(加粗的黄色)%d(%灰度)%C(复位)%C(白色)%s%C %C(复位)' - all
lg2 = log --graph --abbrev-commit --decorate --format =格式:'%C(粗体蓝色)%h%C(复位) - %C (粗体青色)%aD%C(复位)%C(粗体绿色)(%ar)%C(复位)%C(粗体黄色)%d%C(复位)%n%C(白色)%s %C(复位)%C(暗淡的白色) - %an%C(复位)' - all
lg =!git lg1

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.

: 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分支图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 09:16