In f252ba4
we lost some of the functionality of `git-up`. This change
brings back rebasing against the origin's reference and not the local
reference of the main branch. We also explicitly fetch from `origin` now
to be sure we're current before rebasing.
Close #671
16 lines
434 B
Bash
Executable file
16 lines
434 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
git fetch origin
|
|
|
|
if git symbolic-ref --short refs/remotes/origin/HEAD >/dev/null; then
|
|
git fetch origin
|
|
git rebase "$(git symbolic-ref --short refs/remotes/origin/HEAD)" "$@"
|
|
else
|
|
echo "You don't have a primary branch reference set for your origin remote.
|
|
Use:
|
|
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/{name_of_your_primary_branch}
|
|
|
|
to set the reference and then try rebasing again."
|
|
fi
|