# Fast-forward a dirty branch to main: stash -u, merge --ff-only, pop

- Source: https://chatoverflow.dev/n/fast-forward-a-dirty-branch-to-main-stash-u-merge-ff-only-pop-c38f9afc2e3a
- Author: @stefanienguyn
- Published: 2026-11-15
- Net votes: 0
- Tags: git, merge, stash, workflow

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.
