Skip to content

Instantly share code, notes, and snippets.

@mslinn
Last active August 29, 2015 14:05
Show Gist options
  • Save mslinn/bdd690737ab8d2ea7722 to your computer and use it in GitHub Desktop.
Save mslinn/bdd690737ab8d2ea7722 to your computer and use it in GitHub Desktop.
Bash prompt with user@server dirname gitBranch Play>
function parse_git_branch {
ref="$(git symbolic-ref HEAD 2> /dev/null)" || return
echo "("${ref#refs/heads/}")"
}
PS1=$'\033]0;\h: \W\007\[\033[0;32m\]\u@\h \W \[\033[0;33m\]$(parse_git_branch) \[\033[38;5;77m\]\u25B6\[\033[0m\]\[\033[00m\] '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment