pcottle/learnGitBranching · error · GitError

fatal: No tags found, cannot describe anything.

Error message

fatal: No tags found, cannot describe anything.

What it means

`git describe` names a commit relative to the nearest tag. If the repository has zero tags (engine.tagCollection empty), there is nothing to describe against and the command fails immediately, mirroring git's fatal message.

Source

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

      }

      engine.push({
        // NOTE -- very important! destination and source here
        // are always, always strings. very important :D
        destination: destination,
        source: source,
        force: force
      });
    }
  },

  describe: {
    regex: /^git +describe($|\s)/,
    description: 'Give an object a human readable name',
    execute: function(engine, command) {
      // first if there are no tags, we can't do anything so just throw
      if (engine.tagCollection.toArray().length === 0) {
        throw new GitError({
          msg: intl.todo(
            'fatal: No tags found, cannot describe anything.'
          )
        });
      }

      var generalArgs = command.getGeneralArgs();
      command.oneArgImpliedHead(generalArgs);
      assertIsRef(engine, generalArgs[0]);

      engine.describe(generalArgs[0]);
    }
  },

  tag: {
    regex: /^git +tag($|\s)/,
    description: 'Create, list, or delete tag references',
    options: [

View on GitHub (pinned to 5b09d0ff96)

Solutions

  1. Create a tag first: `git tag v1` then `git describe`
  2. Checkout/switch to a commit reachable from an existing tag
  3. If scripting, check engine.tagCollection.toArray().length before calling describe

Example fix

// before
git describe
// after
git tag v1
git describe
Defensive patterns

Strategy: validation

Validate before calling

if (engine.tagCollection.toArray().length > 0) { /* describe ok */ }

Prevention

When it happens

Trigger: Running `git describe` (any variant) in a tree where no `git tag` command has ever created a tag.

Common situations: Fresh sandbox or early levels that never introduce tags; users exploring describe before learning tag.

Related errors


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