I use git mostly in command line. The main reason is to have error messages and an history of what I entered when I do something wrong. It helps me a lot. Writing git status
a dozen time per feature is cumbersome. Let's use aliases.
Back in the time I used to maintain my own list of aliases. In my old .bashrc
you could find lines like:
# print git status
alias gits='git status'
# Pretty print git log
alias gitl='git log --graph --decorate --all'
Some times ago, I found a ready-to-use list I quite like. This list is the Git Alias project from the eponym organisation on GitHub. I will let the project introduce itself from its README:
Git Alias is a collection of git version control shortcuts, functions, and commands:
s
for status
.optimize
to do a prune and repack with recommended settings.topic-start
to create a new topic branch for a new feature.graphviz
to show logs and charts using third-party tools.You can install it in two commands:
curl https://raw.githubusercontent.com/GitAlias/gitalias/master/gitalias.txt -o ~/.gitalias
git config --global include.path ~/.gitalias
Now make it your own!