Skip to content

Instantly share code, notes, and snippets.

@shibumi
Created July 19, 2018 01:13
Show Gist options
  • Save shibumi/ec6312fd2279f6e0f20fedc4e9c0e601 to your computer and use it in GitHub Desktop.
Save shibumi/ec6312fd2279f6e0f20fedc4e9c0e601 to your computer and use it in GitHub Desktop.
prompt_git_dirty() {
if git rev-parse --git-dir > /dev/null 2>&1; then
if [ -z "$(command git status --porcelain --ignore-submodules -unormal)" ]; then
echo "green"
else
echo "yellow"
fi
else
echo "blue"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment