pgit.sh pull: Rebase target branch before merge

Before merging the remote branch, do a rebase. This may fail and
prompt conflict resolution, but that seems the canonical outcome for
the common use case "interactive make git pull-xxx" with master
out-of-sync.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-01-31 11:09:18 +01:00
commit 4431993665

View file

@ -182,6 +182,7 @@ clone()
run_git -C $p fetch --prune --recurse-submodules=on-demand $remotename $fromref run_git -C $p fetch --prune --recurse-submodules=on-demand $remotename $fromref
run_git -C $p submodule foreach --recursive 'git fetch --tags -f origin' run_git -C $p submodule foreach --recursive 'git fetch --tags -f origin'
if [ "$toref" ]; then if [ "$toref" ]; then
run_git -C $p rebase $remotename/$fromref $toref
run_git -C $p merge --ff-only $remotename/$fromref $toref run_git -C $p merge --ff-only $remotename/$fromref $toref
fi fi
else else