{"record":{"id":"5d7d64faf67186d3","repo":"pcottle/learnGitBranching","slug":"branchname-is-not-a-remote-tracking-branch","errorCode":null,"errorMessage":"' + branchName + ' is not a remote tracking branch! I don't know where to push","messagePattern":"' \\+ branchName \\+ ' is not a remote tracking branch! I don't know where to push","errorType":"exception","errorClass":"GitError","httpStatus":null,"severity":"error","filePath":"src/js/git/commands.js","lineNumber":116,"sourceCode":"};\n\nvar assertBranchIsRemoteTracking = function(engine, branchName) {\n  branchName = crappyUnescape(branchName);\n  if (!engine.resolveID(branchName)) {\n    throw new GitError({\n      msg: intl.todo(branchName + ' is not a branch!')\n    });\n  }\n  var branch = engine.resolveID(branchName);\n  if (branch.get('type') !== 'branch') {\n    throw new GitError({\n      msg: intl.todo(branchName + ' is not a branch!')\n    });\n  }\n\n  var tracking = branch.getRemoteTrackingBranchID();\n  if (!tracking) {\n    throw new GitError({\n      msg: intl.todo(\n        branchName + ' is not a remote tracking branch! I don\\'t know where to push'\n      )\n    });\n  }\n  return tracking;\n};\n\nvar commandConfig = {\n  commit: {\n    sc: /^(gc|git ci)($|\\s)/,\n    regex: /^git +commit($|\\s)/,\n    description: 'Record changes to the repository',\n    options: [\n      '--amend',\n      '-a',\n      '--all',\n      '-am',","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/pcottle/learnGitBranching/blob/5b09d0ff9678cad164f5a7488a279a44f90d7256/src/js/git/commands.js#L98-L134","documentation":"The branch exists but branch.getRemoteTrackingBranchID() returns null — it has no configured upstream (no o/<name> counterpart). The command (push without explicit refspec) doesn't know where to push.","triggerScenarios":"git push on a locally-created branch that was never fetched/tracked from origin, so no remote-tracking branch exists.","commonSituations":"Creating a new branch and pushing before setting upstream; classic LearnGitBranching lesson about o/ refs.","solutions":["Push with an explicit refspec: git push origin <branch>","git fetch first so the tracking ref o/<branch> exists","Set the tracking branch (in real git: git push -u origin <branch>)"],"exampleFix":"// before\ngit push\n// after\ngit push origin newbranch","handlingStrategy":"validation","validationCode":"var tracking = branch.getRemoteTrackingBranchID(); if (!tracking) { /* push with explicit refspec instead */ }","typeGuard":"function hasUpstream(branch) { return !!branch.getRemoteTrackingBranchID(); }","tryCatchPattern":"try { push(); } catch (e) { if (/remote tracking branch/.test(e.msg)) pushExplicit('origin', branchName); else throw e; }","preventionTips":["Always fetch before first push of a new branch","Prefer explicit refspecs: git push origin <branch>"],"tags":["git","push","upstream","remote-tracking"],"backgroundTag":"no-upstream-configured","analyzedSha":"5b09d0ff9678cad164f5a7488a279a44f90d7256","analyzedAt":"2026-08-27T13:53:49.057Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}