Skip to content

Instantly share code, notes, and snippets.

@jpstacey
Created October 28, 2011 11:20
Show Gist options
  • Save jpstacey/1322087 to your computer and use it in GitHub Desktop.
Save jpstacey/1322087 to your computer and use it in GitHub Desktop.
Display git branch in your command prompt
# Via rjmackay
# Add git ps1 $(__git_ps1 " (%s)")
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[0;33m\]$(__git_ps1 " (%s)")\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 " (%s)")\$ '
fi
force_color_prompt=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment