Skip to content

Instantly share code, notes, and snippets.

@eldargab
Created December 10, 2012 18:02
Show Gist options
  • Save eldargab/4252184 to your computer and use it in GitHub Desktop.
Save eldargab/4252184 to your computer and use it in GitHub Desktop.
prompt with git branch
function git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/'
}
PS1="\W\$(git_branch) $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment