Skip to content

Instantly share code, notes, and snippets.

@sonulohani
Created September 7, 2020 05:14
Show Gist options
  • Save sonulohani/590f27c14dd1e1432167a983ccbff106 to your computer and use it in GitHub Desktop.
Save sonulohani/590f27c14dd1e1432167a983ccbff106 to your computer and use it in GitHub Desktop.
Bash git
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\] \[\033[01;31m\]\$(git_branch)\[\033[00m\]\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment