
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. Aliases are the small quality of life upgrade that makes Git feel like home: type four letters instead of a full command, and your fingers thank you a thousand times a year.
Check out the commands below for some sample.
🏗️ The Classic SVN-Style Aliases
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 the command line like git ci to commit your changes. If you are coming to Git from SVN, this is the fastest way to keep your muscle memory working: co, br, ci, and st all behave just like the old habits.
🧰 The Power Aliases
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'
The hist alias is the showstopper: it renders a compact, graphical history with the short hash, date, message, and author, which turns the wall of log output into something you actually want to read. The type and dump aliases are the plumbing tools, letting you inspect what Git really stores under the hood, which is exactly how you start to understand the object model.
🧠 Final Thoughts
To conclude, there are many ways to adjust your workflow, especially if you are coming from one VCS to another. One of those things is simplifying commands to emulate a certain behavior, and aliases are the cheapest way to do it: one line of config, and the habit survives the migration.
My advice: start with the four classic aliases, add hist next, and let your own workflow suggest the rest. Within a week, typing git hist will feel as natural as breathing. So guys, what are the things you know you could do on git to simplify your workflow? Hope you enjoyed this article!
