Skip to content

Instantly share code, notes, and snippets.

@carnar
Last active October 7, 2015 12:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carnar/354cf7fbe22f23fdd06f to your computer and use it in GitHub Desktop.
Save carnar/354cf7fbe22f23fdd06f to your computer and use it in GitHub Desktop.
Git Prompt
# 1. Download https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
# 2. Copy this file to somewhere (e.g. ~/.git-prompt.sh).
# 3. Add the following lines to your ~/.bash_profile, ~/.bashrc or ~/.zshrc:
source ~/.git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
PS1='\W$(__git_ps1 " (\e[1;36m%s\e[0m)") \$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment