Git shortcuts using aliases

Here’s a simple way to visualise your Git repository’s commit history:

git log --all --graph --decorate --oneline

To avoid remembering this you can configure an alias:

git config --global alias.graph "log --all --graph --decorate --oneline"

Which effectively defines a new Git command:

git graph

This tip was taken from the Research Computing Service’s course Using Git to Code, Collaborate and Share, which is part of the Graduate School’s Research Computing Skills programme.

Further resources