1. Prettier and More Concise Git Log

Personally, I think the default way the Git log is formatted is not the best: it's kind of verbose and doesn't show branch merges:

https://densitylabs.io/static/65e2998e620c1950e46fb8b4805427e0/0d08a/git_log.png

You can set up the log so that it's more concise and shows branch merges. Add an alias for that:

a) Open (or create) the file ~/.gitconfig

b) If the "[alias]" section is not in your file, then add it at the top of the file as "[alias]" without quotes

c) Below the "[alias]" section add the following:

l = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C( 13 white)%s%C(reset) %C(dim white)- %an%C(reset)'

You just added a new alias that will show you a prettier and more concise Git log. Call it by typing git l in the terminal. Here is an example of how it should look:

https://densitylabs.io/static/370473d704d0af123a99e565676310e7/1478c/git_log_formatted.png

2. Shorter Git Status Alias

What about showing a shorter version of the repo status, removing verbose text that is not super necessary? Here is an example of the verbose text that I’m referring to:

https://densitylabs.io/static/698f09a7e33dda7af3ede8a6b4d88e98/d68ed/git_status.png

Let's add an alias for that, this alias is going to be called "st". Run the following command in the terminal:

$ git config --global alias.st "status --short --branch"

Now when you want to check your repo's status you can call as git st and get a more concise status. Here is an example of how it should look:

https://densitylabs.io/static/d6d113db57e4cba78c2fac627e4197f6/08863/git_status_alias.png

3. Git Diff of a File in Another Branch

Let's say you want to see how the modifications you did to file "my_file.rb" in branch "my-branch" compare to the same file in branch "development". You can do from the terminal by calling: