pcottle/learnGitBranching · error · GitError

' + generalArgs[0] + ' is not a remote in your repository! t

Error message

' + generalArgs[0] + ' is not a remote in your repository! try adding origin to that argument

What it means

assertOriginSpecified throws when an optional first argument is present but is not the literal 'origin'. The simulation only models a single remote named origin, so any other remote name is rejected.

Source

Thrown at src/js/git/commands.js:92

  assertIsRef(engine, ref);
  var obj = engine.resolveID(ref);

  if (obj.get('type') !== 'branch' ||
      !obj.getIsRemote()) {
    throw new GitError({
      msg: intl.todo(
        ref + ' is not a remote branch'
      )
    });
  }
};

var assertOriginSpecified = function(generalArgs) {
  if (!generalArgs.length) {
    return;
  }
  if (generalArgs[0] !== 'origin') {
    throw new GitError({
      msg: intl.todo(
        generalArgs[0] + ' is not a remote in your repository! try adding origin to that argument'
      )
    });
  }
};

var assertBranchIsRemoteTracking = function(engine, branchName) {
  branchName = crappyUnescape(branchName);
  if (!engine.resolveID(branchName)) {
    throw new GitError({
      msg: intl.todo(branchName + ' is not a branch!')
    });
  }
  var branch = engine.resolveID(branchName);
  if (branch.get('type') !== 'branch') {
    throw new GitError({
      msg: intl.todo(branchName + ' is not a branch!')

View on GitHub (pinned to 5b09d0ff96)

Solutions

  1. Use 'origin' or omit the remote argument
  2. Re-check your input: only origin is supported in this app

Example fix

// before
git fetch upstream
// after
git fetch origin
Defensive patterns

Strategy: validation

Validate before calling

if (args.length && args[0] !== 'origin') { args[0] = 'origin'; /* or reject */ }

Prevention

When it happens

Trigger: Commands like fetch/pull/push/fakeTeamwork with a first general arg such as 'upstream' or 'github' instead of 'origin' (or omitted entirely is fine).

Common situations: Translating real-world muscle memory (git pull upstream main) into the simulator; typos like 'orgin'.

Related errors


AI-assisted analysis of pcottle/learnGitBranching@5b09d0ff96 (2026-08-27). Data as JSON: /api/errors/23f77ed6a2c3b07e. Report an issue: GitHub.