Today I learned

Untangling git commit graphs

Many of us have been frustrated with Guitar Hero-like git graphs. These are usually made by tools that can't tidy up the graphs. There's a way to make them readable!

Tig is a fantastic tool for visualizing Git trees in the command line. Press shift-g to switch the commit graph to v1, which simplifies the graph. The example above shows the same fragment of Git history, but changing how it's visualized will make it apparent that it's simply a few PR's being merged en masse.

Try it out yourself

Try Tig out in your package manager! For MacOS, it's available as brew install tig. For Linux, it's available in most distro's repositories.

You have just read Untangling git commit graphs, written on March 24, 2019. This is Today I Learned, a collection of random tidbits I've learned through my day-to-day web development work. I'm Rico Sta. Cruz, @rstacruz on GitHub (and Twitter!).

← More articles