Skip to content

Instantly share code, notes, and snippets.

@VictorNS69
Last active September 9, 2019 15:45
Show Gist options
  • Save VictorNS69/f86527dd094fac13466b61527338438b to your computer and use it in GitHub Desktop.
Save VictorNS69/f86527dd094fac13466b61527338438b to your computer and use it in GitHub Desktop.
Just add these lines to your .bashrc to see in which branch you are working
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="${PS1:0:${#PS1}-3}\$(git_branch)\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment