Skip to content

Instantly share code, notes, and snippets.

@ktimothy
Created September 6, 2013 05:28
Show Gist options
  • Save ktimothy/6459878 to your computer and use it in GitHub Desktop.
Save ktimothy/6459878 to your computer and use it in GitHub Desktop.
show git branch in bash prompt
export PS1='\u@\h: \W$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d "\n" | sed s/^/\ \(/ | sed s/$/\)/ )\$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment