Skip to content

Instantly share code, notes, and snippets.

@wwalker
Last active August 27, 2015 20:00
Show Gist options
  • Save wwalker/f1433fe4a245cd95af65 to your computer and use it in GitHub Desktop.
Save wwalker/f1433fe4a245cd95af65 to your computer and use it in GitHub Desktop.
my git bash setup
optionally_source () {
if [[ -f $1 ]]
then
. $1
fi
}
optionally_source /usr/share/doc/git/contrib/completion/git-prompt.sh
optionally_source /usr/share/doc/git/contrib/completion/git-completion.bash
GIT_PS1_SHOWCOLORHINTS=1
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM="verbose name git"
GIT_PS1_DESCRIBE_STYLE=describe
if type -t __git_ps1 | grep -q function
then
PROMPT_COMMAND='__git_ps1 "\u@\h:\w" "\\\$ "'
fi
diff --git contrib/completion/git-prompt.sh contrib/completion/git-prompt.sh
index 07b52be..ac8fecc 100644
--- contrib/completion/git-prompt.sh
+++ contrib/completion/git-prompt.sh
@@ -192,7 +192,7 @@ __git_ps1_show_upstream ()
if [[ -z "$verbose" ]]; then
case "$count" in
"") # no upstream
- p="" ;;
+ p="&" ;;
"0 0") # equal to upstream
p="=" ;;
"0 "*) # ahead of upstream
@@ -205,7 +205,7 @@ __git_ps1_show_upstream ()
else
case "$count" in
"") # no upstream
- p="" ;;
+ p=" &" ;;
"0 0") # equal to upstream
p=" u=" ;;
"0 "*) # ahead of upstream
@wwalker
Copy link
Author

wwalker commented Aug 27, 2015

the patch is just because I do this:

git checkout -b some_new_branch
edit edit edit
git commit -am 'some commit message'

# sit and wait for it to show up in crucible
# finally figure out it is because I've never run 
    git push --set-upstream origin some_new_branch

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