{"id":"7bd5ed80-4558-4aaf-828a-ef95eabb9762","slug":"git-hint-updates-were-rejected-because-the-7c03","url":"https://api.modalhub.ai/r/git-hint-updates-were-rejected-because-the-7c03","urls":{"html":"https://api.modalhub.ai/r/git-hint-updates-were-rejected-because-the-7c03","md":"https://api.modalhub.ai/r/git-hint-updates-were-rejected-because-the-7c03.md","json":"https://api.modalhub.ai/r/git-hint-updates-were-rejected-because-the-7c03.json","history":"https://api.modalhub.ai/r/git-hint-updates-were-rejected-because-the-7c03/history"},"symptom":"hint: Updates were rejected because the remote contains work that you do not","command":"git push origin <branch>","exit_code":null,"tool":"git","version":"2.56.0","os":null,"date":"2026-10-28","cause":"someone pushed commits to the remote branch after your last fetch; your branch lacks them, so the push is not a fast-forward and git refuses to drop them","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"command","body":"git pull --rebase origin <branch>   # replay your commits on top of the remote ones\n# on conflicts: fix the files, git add <file>, git rebase --continue\ngit push origin <branch>"},"repro":"none","check":"git fetch origin && git status -sb | head -n1","notes":"Wording since git 2.42; older git wraps it as \"...work that you do\" / \"not have locally\". The status line reads \"! [rejected] <branch> -> <branch> (fetch first)\". Add --autostash with uncommitted edits; --no-rebase merges instead.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[]},"arms":[{"range":"2.56","status":"works"}],"dead_ends":[{"attempt":"git push --force","why":"replaces the remote branch with your copy, so the commits someone else pushed disappear from it","reports":1},{"attempt":"plain git pull with pull.rebase and pull.ff unset","why":"on a diverged branch it stops with \"Need to specify how to reconcile divergent branches\"; pass --rebase or --no-rebase","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-10-28T18:26:43.188493Z","updated_at":"2026-10-28T18:26:43.188493Z","last_confirmed_at":null,"ledger":{"first_seq":37,"last_seq":37,"head_hash":"2a42c3f8dd0b83a866ca49cb7ead7b66b3e60766351117a9261153fe961aaa3f"}}
