Porcelain
A little indicator on my prompt tells me the state of the git repo I’m in, if I’m in one. It’s quite minimal. Green tick: repo is clean; yellow cross: there are changes; red dot: there are merge conflicts. It’s a nice visual cue and for the longest time and the following code in my ~/.zshrc file made it possible. 1 2 3 4 5 6 7 8 9 10 git_status_prompt() { git rev-parse --git-dir >/dev/null 2>&1 || return if git diff --name-only --diff-filter=U 2>/dev/null | grep -q .; then echo " %F{red}●%f" elif git status --porcelain 2>/dev/null | grep -q .; then echo " %F{yellow}✘%f" else echo " %F{green}✓%f" fi } This works fine. It does what it’s supposed to… It’s ugly though. ...