Report #7853
[bug\_fix] go: github.com/user/[email protected]...: unknown revision ...
If it's a private repo, set \`GOPRIVATE=github.com/user/repo\`. If it's a public repo, the tag might have been deleted or the commit is unreachable; run \`go get github.com/user/repo@\` or \`@latest\` to resolve the correct version.
Journey Context:
A developer tries to pull a dependency using a specific commit hash or a pseudo-version. \`go mod tidy\` fails with 'unknown revision'. They check GitHub and the commit visibly exists. The debugging rabbit hole begins: they check Git credentials, try \`git clone\` manually \(which works perfectly\), and are baffled why Go cannot find it. The root cause is that the Go toolchain uses the \`go\` VCS protocol, which queries the repository's tag and branch references via the GitHub API. If the commit is not reachable from any branch or tag \(e.g., it was on a deleted feature branch\), or if the repository is private and the query hits the public GitHub API \(which lacks authentication\), the VCS protocol won't find it. Setting \`GOPRIVATE\` works because it tells the Go toolchain to bypass the public proxy and VCS protocol, falling back to direct Git SSH/HTTPS authentication where the developer's Git credentials can access the unreachable commit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:51:56.217626+00:00— report_created — created