Is there a way to rebase which can only rewrite local history (not yet been pushed). I guess it would fallback to merge if that check is not passed.
Here's the problem boiled down to a simple feature-branch.
git checkout -b feature master
# DO WORK
git commit -m "COMMIT1"
git push -u origin feature # COMMIT1 is public
# DO WORK
git commit -m "COMMIT2"
git fetch origin master:master # background update master with some random commits
git rebase master # This rewrites both COMMIT1 and COMMIT2
git push # fails because COMMIT1 was rewritten
git push -f # banned by Infrastructure
So I'd like something like:
git rebase masterwith something similar tomerge --ff-onlythat fails if it would change public historygit pull --rebasebut with "rebase-or-merge" semantics