Last Updated: November 09, 2021
·
2.112K
· dmichaelavila

git graph

Add the following to your ~/.gitconfig to view your git "graph":

You may need to create ~/.gitconfig

[alias]                                                                                                                                                   
    graph = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%aN>%Creset'                                     

With your git configured this way you can run git graph in a repository to view a graph like the following, taken from the open source project boardroom:

Picture

Grouping relevant commits in git is valuable. Doing so in such a way that does not render your git history incomprehensible isn't that difficult, but you have to be deliberate about it. Check out my friend Rudy's quick explanation of how to do this.

full-disclosure I learned this from Brian Riley