Git push rejected (non-fast-forward): preserve remote history

Scope: Git 2.x branch push rules. The remote tip may contain commits your local branch does not contain, or local amend/rebase may have rewritten already published history. The rejection prevents remote commits from being lost.

Fetch first, compare both tips and their merge base, and choose the collaboration policy: merge the remote work or rebase local commits onto it. Resolve conflicts, run the relevant tests, and push the resulting fast-forward history. If a coordinated public-history rewrite is truly intended, an explicit --force-with-lease=<ref>:<expected> is safer than unconditional force because it checks the remote tip you expect. Even an implicit lease can be weakened when a background fetch updates remote-tracking refs.

Do not automatically loop force pushes, discard local changes with reset --hard, or treat branch protection and server hooks as errors to bypass.