Skip to content

Instantly share code, notes, and snippets.

@thiagolsfortunato
Last active May 18, 2021 13:08
Show Gist options
  • Save thiagolsfortunato/8ac0feefab442f8d7a3e340810823bd7 to your computer and use it in GitHub Desktop.
Save thiagolsfortunato/8ac0feefab442f8d7a3e340810823bd7 to your computer and use it in GitHub Desktop.
PS1 Git Branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# Configure PS1
PS1='\[\033[01;32m\][\[\033[01;36m\]./\W/\[\033[01;32m\]]\[\033[01;33m\]$(parse_git_branch)\[\033[01;39m\]\n\[\033[01;32m\]\$\[\033[00m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment