Skip to content

Instantly share code, notes, and snippets.

@javiervidal
Created June 10, 2013 12:02
Show Gist options
  • Save javiervidal/5748246 to your computer and use it in GitHub Desktop.
Save javiervidal/5748246 to your computer and use it in GitHub Desktop.
PS1 with git branch
export PS1='\[\033[0;36m\][\h] \[\033[0;35m\]\u\[\033[0;33m\] \w\[\033[0;00m\] \[\033[0;37m\]$(__git_ps1 "(%s)")\[\033[0;00m\] $ '
@christos
Copy link

function parse_git_branch {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/@\1/'
}

export PS1 = "\[\033[G\]\[\033[01;32m\][\w\[\033[0;31m\]$(parse_git_branch)\[\033[01;32m\]]>\[\033[00m\]"

@javiervidal
Copy link
Author

Which shell do yo use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment