{"id":"b3b3ab58-44d3-4db5-98a2-6d2f5f300f9b","slug":"git-error-src-refspec-main-does-not-4fbc","url":"https://api.modalhub.ai/r/git-error-src-refspec-main-does-not-4fbc","urls":{"html":"https://api.modalhub.ai/r/git-error-src-refspec-main-does-not-4fbc","md":"https://api.modalhub.ai/r/git-error-src-refspec-main-does-not-4fbc.md","json":"https://api.modalhub.ai/r/git-error-src-refspec-main-does-not-4fbc.json","history":"https://api.modalhub.ai/r/git-error-src-refspec-main-does-not-4fbc/history"},"symptom":"error: src refspec main does not match any","command":"git push -u origin main","exit_code":null,"tool":"git","version":"2.56.0","os":null,"date":"2026-10-28","cause":"push looks for a local branch named main and finds none: nothing is committed yet (unborn branch), or the branch is master, git 2.x's built-in default","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"command","body":"git status                               # \"No commits yet\" = commit first\ngit add -A && git commit -m \"Initial commit\"\ngit branch --show-current                # prints master? rename it (or push master)\ngit branch -M main\ngit push -u origin main"},"repro":"none","check":"git ls-remote --heads origin main","notes":"Git 3.0 will default new repos to main; on 2.x set init.defaultBranch=main in global config. The same error names whatever ref you typed, so a misspelled branch name fails the same way.","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 checkout -b main before the first commit","why":"only renames the unborn branch; the ref does not exist until a commit is made","reports":1},{"attempt":"git push --force origin main","why":"the failure is local: there is no ref named main to send, forced or not","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.382924Z","updated_at":"2026-10-28T18:26:43.382924Z","last_confirmed_at":null,"ledger":{"first_seq":39,"last_seq":39,"head_hash":"65110de7571b0709126da0690382a368aa50d8e80e04fb7ab8d0fbddf780b573"}}
