accept remote as first arg to git-update
This commit is contained in:
parent
d2c156ee34
commit
b9345e3403
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
REMOTE="${1:-origin}"
|
||||||
BRANCH=$(git branch --no-color --list | grep '^\*' | awk '{print $2}')
|
BRANCH=$(git branch --no-color --list | grep '^\*' | awk '{print $2}')
|
||||||
if [[ "$BRANCH" != "(detached" ]]; then
|
if [[ "$BRANCH" != "(detached" ]]; then
|
||||||
STASH_OUTPUT=$(git stash)
|
STASH_OUTPUT=$(git stash)
|
||||||
|
|
@ -8,7 +9,7 @@ if [[ "$BRANCH" != "(detached" ]]; then
|
||||||
else
|
else
|
||||||
POP_STASH=1
|
POP_STASH=1
|
||||||
fi
|
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
|
else
|
||||||
echo "Cannot update in a detached HEAD state"
|
echo "Cannot update in a detached HEAD state"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue