Skip to content

Instantly share code, notes, and snippets.

@jseabold
Created July 2, 2013 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jseabold/5911810 to your computer and use it in GitHub Desktop.
Save jseabold/5911810 to your computer and use it in GitHub Desktop.
Prompt that includes the github branch name.
# place in .bashrc
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
PS1="[\w] \$(parse_git_branch)\n|\# \$ "
PS2="\[\033[1;33m...\[\033[0m\]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment