Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
463 views
in Technique[技术] by (71.8m points)

git - 漂亮的git分支图(Pretty git branch graphs)

I've seen some books and articles have some really pretty looking graphs of git branches and commits.

(我已经看到一些书籍和文章有一些非常漂亮的git分支和提交图。)

How can I make high-quality printable images of git history?

(如何制作git历史的高质量可打印图像?)

  ask by krosenvold translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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看起来像这样:)
git lg1

and git lg2 looks like this:

(和git lg2看起来像这样:)
git lg2


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...