Friday, April 12, 2013

Git: Alias aka shortcut your GIT commands

If you are familiar with the concept of shortcuts for ease of command or data access, and you used to use such a facility at your daily working bases. You will not find this comes with GIT version control system.

By default, Git does not come with any shortcuts, but you can add your own by aliasing commands.

If you are coming from an SVN background, you will appreciate the following bindings:

Then instead of typing the following command $git commit -m "my first comment", it could be re-written as the following: $git ci -m "my first comment".

Any shortcut or aka alias for any Git command could be defined via Git global configuration as illustrated in the above commands snippet.

Learn more by running the git help config in your Git Bash prompt.