Skip to content

Instantly share code, notes, and snippets.

@MMachado-uy
Last active November 15, 2019 16:40
Show Gist options
  • Save MMachado-uy/3fac2c9b6ee0800277c84faaecdf7a97 to your computer and use it in GitHub Desktop.
Save MMachado-uy/3fac2c9b6ee0800277c84faaecdf7a97 to your computer and use it in GitHub Desktop.

Pretty print git logs in one line Optionally, add -<number> to increase the log reach

$ git config --global alias.lg 'log --format="%C(auto)%h %Cgreen%s %Creset(%cN, %cr) %C(auto)%d" -10'

Show diff in commits between two branches Use as $ git branch-diff <branch1>..<branch2> Add the --reverse flag to show the log in "GitHub order"

$ git config --global alias.branch-diff 'log --pretty=format:"%C(auto)%h %Cgreen%s %Creset(%cN, %cr) %C(auto)%d" --abbrev-commit --date=relative'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment