Share Pastebin
Guest
Public paste!

bstaz

By: a guest | Mar 19th, 2010 | Syntax: Bash | Size: 0.41 KB | Hits: 23 | Expires: Never
Copy text to clipboard
  1. #override __git_ps1
  2. __git_ps1 ()
  3. {
  4.         local b="$(git symbolic-ref HEAD 2>/dev/null)"
  5.         local r="$(git remote -v 2>/dev/null| head -n 1 | awk '{print $2}')"
  6.         if [ -n "$b" ]; then
  7.                 if [ -n "$1" ]; then
  8.                         printf "$1" "${b##refs/heads/}"
  9.                 else
  10.                         printf "%s(%s)" "${r}" "${b##refs/heads/}"
  11.                 fi
  12.         fi
  13. }