Pretty git branch graphs

前端 未结 30 2394
情话喂你
情话喂你 2020-11-22 01:34

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?

30条回答
  •  离开以前
    2020-11-22 01:51

    git-forest is an excellent perl script I've been using for more than a year and I hardly use the git log command directly any more.

    These are some of the things I love about this script:

    • It uses unicode characters to draw the lines in the graph giving a more continuous look to the graph lines.
    • You can combine --reverse with the graph output, which is not possible with the regular git log command.
    • It uses git log internally to grab the list of commits, so all options that you pass to git log can also be passed to this script as well.

    I have an alias using git-forest as follows:

    [alias]
    tree = "forest --pretty=format:\"%C(red)%h %C(magenta)(%ar) %C(blue)%an %C(reset)%s\" --style=15 --reverse"
    

    This is how the output looks like on a terminal:

提交回复
热议问题