I\'m curious if there is a way to show branch hierarchy on the command line? For instance if I use git branch
, instead of seeing output like this:
*
I want to complete the answer of @ctcherry.
I like when I can also see the user who did the commit and the date, so this is the following line to use :
git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
However this is a pretty long line and difficult to memorize so you can use an alias. You just have to use this in your terminal :
git config --global alias.lg "HERE GOES MY BIG LOG COMMAND LINE"
To summarize copy and paste the line below on your terminal:
git config --global alias.lg "log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
Then you will just have to use git lg
to get your log history tree.
Example:
src