Skip to content

Instantly share code, notes, and snippets.

@jphase
Created August 4, 2014 22: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 jphase/d334e6a588c685b465d3 to your computer and use it in GitHub Desktop.
Save jphase/d334e6a588c685b465d3 to your computer and use it in GitHub Desktop.
Fancy terminal prefix for branches - and the ultimate "git clean" command :)
# git
alias gitclean='git diff --diff-filter=D --name-only -z | xargs -0 git rm'
# git fancy console prefix
export PS1="\`if [ \$? = 0 ]; then echo \[\033[32m\]ツ\[\033[0m\]; else echo \[\e[31m\]益\[\e[0m\]; fi\` \[\033[1;30m\](\A)\[\033[00m\] \[\033[37m\]\u\[\033[36m\]@\[\033[0m\]\h\[\033[01;34m\] \w \[\033[31m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.each_line.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[37m\]$\[\033[00m\] "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment