small useful git tricks
Here’s a couple of git aliases I use all the time. It gives you a quick and clear overview of your branches and
commits. It can even watch for changes in realtime and show you any changes.

A better git log
Add this to your .gitconfig:
| |
Run git tree and you get a compact view of your commit history with branches, colored hashes, commit messages, and authors. The --all flag shows all branches, not just the current one.
Live-updating git log
This one needs viddy, which is like watch but better. Install it with brew install viddy on Mac or go install github.com/sachaos/viddy@latest if you have Go.
| |
Run git watch-tree and you get a live view that updates every second. The head -n $(tput lines) part limits the output to your terminal height so it doesn’t scroll. The -c color.ui=always keeps the colors when piping through viddy.
I keep this running in a terminal while I work. When I commit or switch branches, the view updates automatically.