summaryrefslogtreecommitdiff
path: root/miguel-git-prompt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'miguel-git-prompt.sh')
-rw-r--r--miguel-git-prompt.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/miguel-git-prompt.sh b/miguel-git-prompt.sh
new file mode 100644
index 0000000..031e883
--- /dev/null
+++ b/miguel-git-prompt.sh
@@ -0,0 +1,17 @@
+miguel_git_prompt ()
+{
+ RED="\[$(tput setaf 1)\]"
+ GREEN="\[$(tput setaf 2)\]"
+ RESET="\[$(tput sgr0)\]"
+
+ PS1=" \w"
+ if git rev-parse --git-dir > /dev/null 2>&1; then
+ PS1+=" [$RED"
+ PS1+=`git status --porcelain | awk '{print $1}' | sort | uniq | tr '\n' ' '`
+ PS1+="$GREEN"
+ #PS1+=`git branch --show-current`
+ PS1+=`git status --porcelain -b | head -n1`
+ PS1+="$RESET]"
+ fi
+ PS1+=" $ "
+}