Git Helpers

3 February 2023

Pretty Log:

My fist alias is the "pretty" alias. This alias provides a visual representation of your Git commit history, making it easier to understand and navigate. The command for the "pretty" alias is:

pretty = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

When you run git pretty, you will see a graph of your commit history, with each commit represented by a colored node. The color coding makes it easy to identify the branch that a commit belongs to, as well as the author of the commit.


Another useful alias is "conflicts". This alias shows you a list of files that have conflicts in a merge or rebase operation. The command for the "conflicts" alias is:

conflicts = diff --name-only --diff-filter=U --relative

Running git conflicts will show you a list of files that have conflicts, making it easier to resolve the conflicts and complete your merge or rebase.

Further Reading

  1. What did I work on yesterday?
  2. Faster git workflow with aliases