Skip to content

Instantly share code, notes, and snippets.

@thekid
Created May 6, 2014 15:00
Show Gist options
  • Select an option

  • Save thekid/0c2674db32b67065175b to your computer and use it in GitHub Desktop.

Select an option

Save thekid/0c2674db32b67065175b to your computer and use it in GitHub Desktop.
prompt
branch_info() {
branch=`git name-rev HEAD --name-only 2>/dev/null`
if [ 0 = $? ] ; then
printf "$1" $branch
fi
}
export PS1="\[\e]0;\w\a\]\n\[\e[31m\]\u@\h \[\e[36m\]\w\$(branch_info ' [\[\033[01;32m\]%s\[\033[01;36m\]] ')\[\e[0m\]\n\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment