Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (25 sloc) 1017 Bytes
layout title
Persistent git log with git loglive

I recently watched a talk by Tim Berglund on advanced git - wherein he demos some git plumbing commands with a git log that keeps refreshing.

It looks like this:

This is incredibly useful for visualizing what's happening to your repository as you switch between and modify branches.

The code below has been reproduced from his original gist

{% highlight bash %} #!/bin/bash

while : do clear git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $* sleep 1 done {% endhighlight %}

I had to create a new file with the above contents somewhere in my PATH. I created a file called git-loglive in /usr/local/bin/

If your commit history is longer than your terminal window is tall, you might need to specify that you only want the top 10 commits or so.

$ git loglive -10
You can’t perform that action at this time.