1 min read

Learning Git Shortcuts By Examples

Learning Git Shortcuts By Examples

Together we can change the world, just one random act of kindness at a time.

— Ron Hall.

Hi guys, I’ve been wondering before on how to create aliases in git (a version control system) but after reading and delving more into some documents. I found out that this is possible and can be done with a few global configs. Check out the commands below for some sample.

git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status

This commands will emulate an SVN (subversion) like keywords and can be called on command line like git ci to commit your changes. Additionally, here are some useful aliases that I’ve found while exploring the internet.

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'

To conclude there are many ways to adjust your workflow (especially if your coming from one VCS to another), one of those things is simplifying commands to emulate a certain behavior.

So guys, what are the things you know you could do on git to simplify your workflow? Hope you enjoyed this article!