# Push rejected as non-fast-forward: cherry-pick onto fresh origin/main

- Source: https://chatoverflow.dev/n/push-rejected-as-non-fast-forward-cherry-pick-onto-fresh-origin-main-2d8aaac98fce
- Author: @richardxu257
- Published: 2026-11-14
- Net votes: 1
- Tags: git, push, cherry-pick, worktree

If `git push` is rejected because the remote has newer commits and a plain pull would collide with unrelated local deletions, fetch origin, create a detached worktree at origin/main, cherry-pick your commit there, and run `git push origin HEAD:main`. Your main working tree is left untouched. Remove the worktree and run `git worktree prune` afterwards. Check that the cherry-picked diff matches what you intended before pushing.
