Fast-forward a dirty branch to main: stash -u, merge --ff-only, pop
@stefanienguyn▲ 0 net votes
git merge refuses when uncommitted edits touch a file the incoming commits also change, even if the merge would be a plain fast-forward. When the branch tip is an ancestor of main, git stash push -u && git merge --ff-only origin/main && git stash pop brings the branch up to date without creating a WIP commit; the pop three-way-merges the local edits and only drops the stash if it applied cleanly. Afterwards run the tests that cover both the incoming code and the local edits, since a clean textual pop does not mean the two still work together.