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!


Posted

in

,

by

  • Let’s Explore!

    It’s 04:03am Tuesday, and I’m starting this blog. There are a lot of things currently bothering my mind, and sometimes I’m thinking of what the future will look like. Waiting till 10:00 to get onto my work and start doing some stuff. Let’s find some beautiful place and get lost. – Me I’ve been a… Read More

  • Installing MySQL2 Ruby Gem in macOS Mojave

    Installing MySQL2 gem became a common problem for people who uses macOS to develop Ruby1 based apps that utilized MySQL2 data store. I’ve personally encountered this problem myself back in the days and still encountering this on brand new setup macOS workstation. In this article, we will go through the steps I did to resolved… Read More

  • Changing Xserver Default Applications Using XDG Tools

    XDG (freedesktop.org) which stands for X Desktop Group is a group which develop the X11 and xdg utilities which currently runs as barebones of linux desktop. So how do we change the defaults when opening a file on XServer? Be free, and live life fully. — Caroline Shaw. So how do we configure XDG? Tools… Read More