Skip to content

Instantly share code, notes, and snippets.

@mithun3
Last active April 14, 2019 05:06
Show Gist options
  • Save mithun3/dde74709882b820aa9ff77b8802e54d3 to your computer and use it in GitHub Desktop.
Save mithun3/dde74709882b820aa9ff77b8802e54d3 to your computer and use it in GitHub Desktop.
Different types of logs
#To make a shortcut for this command, you may want to edit your ~/.gitconfig file:
[alias]
gr = log --graph --full-history --all --color --pretty=tformat:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s%x20%x1b[33m(%an)%x1b[0m"
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
#https://stackoverflow.com/questions/1057564/pretty-git-branch-graphs
#https://stackoverflow.com/questions/1838873/visualizing-branch-topology-in-git/34467298#34467298
@mithun3
Copy link
Author

mithun3 commented Apr 14, 2019

git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

git lg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment