Here, we'll see some examples of aliases, with a short description of each of them and an example of how to use them. The aliases are just made for the local repository; use --global to make them available for all the repositories.
- Let's begin with an alias to show the current branch only:
$ git config alias.b "rev-parse --abbrev-ref HEAD" $ git b aliases
- To show a compact graph history view with colors, the following alias will save you many keystrokes:
$ git config alias.graph "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" $ git graph origin/conflict aliases
The following screenshot shows you a typical output, where commits ...