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.




And if that’s not short enough, you can add even shorter aliases to ~/.bashrc:
Very practical when you spend the entire day using these commands :)
You probably want to use ‘git config—global’ for aliases. Otherwise, it will only be saved in your current repo’s .git/config, rather that ~/.gitconfig. Of course, having per-project aliases could be useful, but I haven’t thought of a use case for that yet.
I love using git-sh:
http://github.com/rtomayko/git-sh/tree/master
not quite as short as the aliases above but you can leave off the ‘git’ part at least.
I have the most confusing time trying to understand subversion. Does anybody here think that Git is easier to pick up? I hope so.