From b9345e3403ec0993e2767796283e6504795be6fe Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Thu, 5 Mar 2015 19:33:48 -0800 Subject: [PATCH] accept remote as first arg to git-update --- git-update | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-update b/git-update index 02cd255..7887fa7 100755 --- a/git-update +++ b/git-update @@ -1,5 +1,6 @@ #!/bin/sh +REMOTE="${1:-origin}" BRANCH=$(git branch --no-color --list | grep '^\*' | awk '{print $2}') if [[ "$BRANCH" != "(detached" ]]; then STASH_OUTPUT=$(git stash) @@ -8,7 +9,7 @@ if [[ "$BRANCH" != "(detached" ]]; then else POP_STASH=1 fi - git fetch --prune --tags origin && git rebase "origin/$BRANCH" && ([[ $POP_STASH -eq 1 ]] && git stash pop) || true + git fetch --prune --tags "$REMOTE" && git rebase "$REMOTE/$BRANCH" && ([[ $POP_STASH -eq 1 ]] && git stash pop) || true else echo "Cannot update in a detached HEAD state" fi