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.
Solutions
- Create a tag first: `git tag v1` then `git describe`
- Checkout/switch to a commit reachable from an existing tag
- 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
- Create at least one tag before demonstrating describe
- Guard scripts with a tag-count check
- Teach tag before describe in curricula
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
- <dynamic describe output: foundTag>
- <dynamic describe output: foundTag-N-g
- Fatal: no tags found upstream
- bad-branch-name
- Bad numeric argument: ' + generalArgs[1]
AI-assisted analysis of pcottle/learnGitBranching@5b09d0ff96 (2026-08-27).
Data as JSON: /api/errors/34e4ff56e9207ce5.
Report an issue: GitHub.
Appendix: 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)