Pretty git branch graphs

前端 未结 30 2642
情话喂你
情话喂你 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:52

    I have this git log alias in ~/.gitconfig to view the graph history:

    [alias]
    l = log --all --graph --pretty=format:'%C(auto)%h%C(auto)%d %s %C(dim white)(%aN, %ar)'
    

    With this in place, git l will output something like:

    In Git 2.12+ you can even customize the line colors of the graph using the log.graphColors configuration option.

    As for the logs' format, it's similar to --oneline, with the addition of the author name (respecting .mailmap) and the relative author date. Note that the %C(auto) syntax, which tells Git to use the default colors for commit hash, etc. is supported in Git >= 1.8.3.

提交回复
热议问题