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 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.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
[alias]
  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!

0 comments: