Skip to main content

TIL: 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!

Comments

Popular posts from this blog

TIL: Disable mDNS and SSDP Discovery in Google Chrome

We're born alone, we live alone, we die alone. Only through our love and friendship can we create the illusion for the moment that we're not alone. — Orson Welles.

TIL: Flutter Series - Custom Icons

Everyone thinks of changing the world, but no one thinks of changing himself. — Leo Tolstoy.

TIL: Editor Series - Configuring Emacs To Fit The Needs Part 2

The world as we have created it is a process of our thinking. It cannot be changed without changing our thinking. — Albert Einstein.

TIL: Gimp Automating Image Processing with Python Fu

What a large volume of adventures may be grasped within the span of his little life by him who interests his heart in everything. — Laurence Sterne.