Last active
May 18, 2021 13:08
-
-
Save thiagolsfortunato/8ac0feefab442f8d7a3e340810823bd7 to your computer and use it in GitHub Desktop.
PS1 Git Branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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