Last active
November 21, 2022 00:46
-
-
Save elVengador/9c84fe1b0004760d926bc477970fb896 to your computer and use it in GitHub Desktop.
Simplify bash text (PS1)
This file contains hidden or 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
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/:\1/' | |
} | |
export PS1="\W\$(git_branch) > \[${RESET}\]" | |
## result, when there isn't branch: | |
## PATH > | |
## result, when there is branch: | |
## PATH:BRANCH > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment