How to do it...

  1. First, we'll create a few simple aliases, then a couple of more special ones, and finally, a couple of aliases using external commands. Instead of writing git checkout every time we need to switch branches, we can create an alias of that command and call it git co. We can do the same for git branch, git commit, and git status as follows:
$ git config --global alias.co checkout 
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status 
  1. Now, try to run git st in the jgit repository as follows:
$ git st
# On branch master
nothing to commit, working directory clean  
  1. The alias method is also good for creating the Git commands you think are missing in Git. One of the ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.