Git Command Aliases

This is kind of a tip of the day, but I just think its cool so I am sharing it with everyone. And being a recent convert to Git and the fact that I have to use Subversion at my place of work, I find myself constantly doing things like this out of habit.

$ git st  && git ci

Well now I can do that (although it may not be a good idea) with git alias:

elubow@beacon (master) supportskydivers$ git config --global alias.st status
elubow@beacon (master) supportskydivers$ git config --global alias.ci commit
elubow@beacon (master) supportskydivers$ git st && git ci
# On branch master
nothing to commit (working directory clean)

Now st and ci are git aliases for status and commit respectively.

Posted in Tips. Tags: , . 2 Comments »
  • alecthegeek

    Defining an alias “k = !gitk” can be useful. gitk then becomes 'git k' which can be good if your fingers work that way. NB Not my idea, but I can't remember who πŸ™

  • alecthegeek

    Defining an alias “k = !gitk” can be useful. gitk then becomes 'git k' which can be good if your fingers work that way. NB Not my idea, but I can't remember who πŸ™