Making Git Commands A Little Shorter

Most of you git geeks probably already knew this, but recently I learned how to make git a little more usable for me.

One of the things I appreciate about Subversion’s command line interface is that, usually, you don’t have to type the entire command name. As long as you enter enough of the command so it can’t be confused with another subversion command, it will work.

For example, instead of doing:

svn status

I always do

svn st

(i know, I know, you can go even further and create shell aliases that are even further, or shell scripts, or whatever…)

Anyway, now that I’m using git for my personal projects, I end up doing this a lot:

git status

But recently I learned that I can make this shorter by creating a git alias for the status command (or any other command I want).

So I did this:

git config alias.st status

Now I can do this instead:

git st

You can do the same for git commit:

git config alias.ci commit

For more information about how to create aliases in git, well… just Google for it. You’ll be glad you did.