5 Git Tricks That I Wish I Had Known Earlier

1. Run git lola to Visualize Commit History

When working with Git versioning, it is crucial to be able to visualize your Git branches.

Git commands can be long and tedious to type out. To save yourself some effort in the future, let’s set up one useful Git command that helps you visualize your Git branching history.

In the terminal:

vim ~/.gitconfig

And then in the gitconfig file, add in the following snippet:

[alias] lola = log --graph --decorate --pretty=oneline --abbrev-commit --all --date=local

I just cloned a brand new project that only has the initial commit to it. This is what the commit history from git lola looks like:

Commit history

Note: You may customize your command to say something other than _lola_, but it is an industry custom. Unless you have strong reasons to go with another command, just keep the command as _lola_.

#git #programming #software development

5 Git Tricks That I Wish I Had Known Earlier
8.25 GEEK