Skip to content

Instantly share code, notes, and snippets.

@tlberglund
Last active September 18, 2025 07:57
Show Gist options
  • Select an option

  • Save tlberglund/3714970 to your computer and use it in GitHub Desktop.

Select an option

Save tlberglund/3714970 to your computer and use it in GitHub Desktop.
Log Live Git Command
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1
done
@obstschale

Copy link
Copy Markdown

Just watched your git advanced presentation at JavaZone. Awesome stuff! And thx for that nice git-loglive script

@jdmanuel

Copy link
Copy Markdown

thanks. very useful

@gnomix

gnomix commented Aug 10, 2013

Copy link
Copy Markdown

indeed a good one!

@sebastianjt

Copy link
Copy Markdown

This is an awesome script.

Quick question: After it has run for a certain period of time it simply stops. It shows "(END)" at the very bottom and wont continue looping.

What can this issue be?

@tlberglund

Copy link
Copy Markdown
Author

@sebastianjt Not sure! Is your log longer than the terminal window? Sometimes I'll run it with a commit limit (git loglive -15) to help things fit.

@benedictchen

Copy link
Copy Markdown

This is awesome! Thank you.

@benedictchen

Copy link
Copy Markdown

This is awesome! Thank you.

@Netznarkose

Copy link
Copy Markdown

this helped me a lot getting into git, thank you

@taliaga

taliaga commented May 15, 2016

Copy link
Copy Markdown

Thanks Tim, btw, nice git talk!

@Netznarkose

Netznarkose commented Aug 16, 2016

Copy link
Copy Markdown

I just wanted to share a modification of this script. it shows the logs depending on the position of HEAD.

#!/bin/bash

while :
do
    clear
    git --no-pager log `git rev-parse HEAD` -n $* --graph --pretty=oneline --abbrev-commit --decorate
    sleep 1
done

git_loglive_netznarkose

@madivad

madivad commented Jul 30, 2017

Copy link
Copy Markdown

Nice snippet. I just caught your talk on YouTube. Thanks, it cleared up a lot of confusion. Side note, my dyslexia read this snippet as got-love :)

@Angelfirenze01

Copy link
Copy Markdown

I came across Git From The Bits Up on YouTube and, wow, you actually talk about things I've never heard of in nearly six years of using Git! I'm learning instead of reviewing! Thanks!

@algonzalez

Copy link
Copy Markdown

Added a version that will run on Microsoft Windows: https://gist.github.com/algonzalez/f8af7a727248b2a53ed2bcc62bcc56ba

@fira42073

fira42073 commented Sep 24, 2021

Copy link
Copy Markdown

Recently watched your talk on javazone, just loved id!

Btw, you can also use watch command instead of while loop in bash

watch -cwt unbuffer git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment