Skip to content

Instantly share code, notes, and snippets.

@gregjhogan
Last active August 17, 2023 00:45
Show Gist options
  • Save gregjhogan/0444ec69708755474a9665029db4ba9c to your computer and use it in GitHub Desktop.
Save gregjhogan/0444ec69708755474a9665029db4ba9c to your computer and use it in GitHub Desktop.
bash prompt with git status
source ~/.git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
PS1='\[\033[1;32m\]\u@\h \[\033[0;36m\]\w\[\033[1;33m\]$(__git_ps1 " (%s)")$([ $? -ne 0 ] && echo -n " \[\e[0;31m\]!")\n\[\033[0m\]$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment