Created
May 7, 2021 16:23
-
-
Save BryanSchuetz/f59001a6969bd2e2cae2d63c35a9ec18 to your computer and use it in GitHub Desktop.
Git branch in bash prompt
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)/' | |
} | |
NO_COLOR="\[\033[0m\]" | |
RED="\[\033[0;31m\]" | |
export PS1="⚑$RED\$(parse_git_branch) $NO_COLOR\w >" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment