Pretty git branch graphs

前端 未结 30 1984
情话喂你
情话喂你 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 02:06

    Very slightly tweaking Slipp's awesome answer, you can use his aliases to log just one branch:

    [alias]
    lgBranch1 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
    lgBranch2 = log --graph --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(bold white)— %an%C(reset)' --abbrev-commit
    lg = !"git lg1"
    

    By leaving off the --all you can now do

    git lgBranch1 
    

    or even

    git lgBranch1 --all
    

提交回复
热议问题