Skip to content

Instantly share code, notes, and snippets.

@algonzalez
Forked from tlberglund/git-loglive
Last active March 23, 2021 18:08
Show Gist options
  • Save algonzalez/f8af7a727248b2a53ed2bcc62bcc56ba to your computer and use it in GitHub Desktop.
Save algonzalez/f8af7a727248b2a53ed2bcc62bcc56ba 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
@echo off
REM version of https://gist.github.com/tlberglund/3714970 that will run on Microsoft Windows
:repeat
cls
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all %*
timeout 1 >nul
goto repeat
# version of https://gist.github.com/tlberglund/3714970 that will run with PowerShell
# add `git loglive -15` to limit the number of commits to list (15 in this case)
do {
Clear-Host
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $Args
Start-Sleep -Seconds 1
} while ($true)
# OR as a function
function git-livelog {
param ([int]$sleepSeconds=1)
if ($sleepSeconds -lt 1 -or $sleepSeconds -gt 600) {$sleepSeconds = 1}
do {
Clear-Host
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $Args
Start-Sleep -Seconds $sleepSeconds
} while ($true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment