Skip to content

Instantly share code, notes, and snippets.

@elVengador
Last active November 21, 2022 00:46
Show Gist options
  • Save elVengador/9c84fe1b0004760d926bc477970fb896 to your computer and use it in GitHub Desktop.
Save elVengador/9c84fe1b0004760d926bc477970fb896 to your computer and use it in GitHub Desktop.
Simplify bash text (PS1)
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