Aliases for git commands

2015/04/09

You can easily add aliases for common git commands with one of the following ways:

Use the command line

git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.df diff
git config --global alias.mg merge

Edit directly the .gitconfig file located in your home directory

vim ~/.gitconfig

and then add

[alias]
  co = checkout
  ci = commit
  st = status
  br = branch
  df = diff
  mg = merge

Now you can run git commands like

git co
git ci
git st
git br
git df
git mg

Categories: posts Tags: git