How to do it...

It's very simple and straightforward to create an alias. You simply need to configure it with git config.

What we will do is check a branch and then create its aliases one by one and execute them to view their output by performing the following steps:

  1. So, we will start by checking a branch named gitAlias, which tracks the origin/stable-3.2 branch:
$ git checkout -b gitAlias --track origin/stable-3.2
Branch gitAlias set up to track remote branch stable-3.2 from origin.
Switched to a new branch 'gitAlias'
  1. After this, we can start creating some aliases. We will start with the following one, which will simply just amend your commit:
$ git config alias.amm 'commit --amend'
  1. Executing this alias will open the commit message ...

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.