mikecharles
4/7/2016 - 12:58 AM

Display git status and graph continuously in the terminal

Display git status and graph continuously in the terminal

while true ; do
  clear
  printf "\e[0;35mgit status\n----------\n\n\e[m"
  git status
  printf "\e[0;35m\ngit graph\n---------\n\n\e[m"
  git --no-pager tree --branches --remotes --tags -n 15
  sleep 2
done

Note that this requires the following alias set in $HOME/.gitconfig:

[alias]
  tree = "!f() { git log $@ --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit ; }; f"