Search This Blog

Jul 15, 2014

GIT Commads Aliases

Using GIT commands Aliases are very helpful. I use them to make my your work easier with regards on GIT. In order to add aliases, simply run the following commands in GIT BASH or by adding it on the .gitconfig file.
Using GIT Bash
git config --global checkout
git config --global commit
git config --global status
git config --global branch
git config --global alias.hist 'log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short'
git config --global alias.type 'cat-file -t'
git config --global alias.dump 'cat-file -p'
Using .gitconfig
  co = checkout
  ci = commit
  st = status
  br = branch
  hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
  type = cat-file -t
  dump = cat-file -p
That's it, you can now start using those aliases. For example, instead of using git status you can use git st and so on. Happy GIT-ing!