Published: September 24, 2018
One of the biggest benefits for growing developers is to have a strong toolbox of command line interface (CLI) tools to improve your efficiency. This series is about the tools that I'm learning or have learned to use and why:
Where better to start than Git which is arguably is the most important command line tool that a developer can learn outside of an in-terminal editor like Vim or Emacs. It allows us to easily incrementally save and share progress on projects via hosted repositories like GitHub and GitLab. You can easily work on new ideas in their own branch before merging your main project ("master branch") with your new idea ("idea branch").
I have an alias called detail-log
that I use to review my previous commits across my branches. It provides a visually drawn-out terminal log of my commits and how they apply to branches.
This is the alias:
[alias]
detail-log = log --graph --decorate --oneline
It's simply doing three things, listing out the visual graph of my branches then aligning my commits in one line rows along those branches and color coding them.
If you want to use this you can simply type git config --global alias.detail-log log --graph --decorate --oneline
in your command line or open up ~/.gitconfig
with vi
or nano
and copy/paste the alias code block above and restart your terminal. Then, next time you type git detail-log
in a project you should have an easily readable commit log.