Skip to content

Instantly share code, notes, and snippets.

@huenisys
Last active July 27, 2019 23:29
Show Gist options
  • Save huenisys/9e6901c039500ec714c0fa9bd75de4e2 to your computer and use it in GitHub Desktop.
Save huenisys/9e6901c039500ec714c0fa9bd75de4e2 to your computer and use it in GitHub Desktop.
ubuntu bash prompt with git branch
if [ "$color_prompt" = yes ]; then
# orig: PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\h\[\033[00m\]::\[\033[91m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[35m\]$(__git_ps1)\[\033[00m\]\$ '
else
# orig: PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1)\$ '
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment