{"record":{"id":"49308d6349891ae3","repo":"mislav/hub","slug":"error-s-s-doesn-t-have-a-wiki","errorCode":null,"errorMessage":"Error: %s/%s doesn't have a wiki","messagePattern":"Error: (.+?)/(.+?) doesn't have a wiki","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands/clone.go","lineNumber":142,"sourceCode":"\tif expectWiki {\n\t\tname = strings.TrimSuffix(name, \".wiki\")\n\t}\n\n\tproject := github.NewProject(owner, name, hostStr)\n\tgh := github.NewClient(project.Host)\n\trepo, err := gh.Repository(project)\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"HTTP 404\") {\n\t\t\terr = fmt.Errorf(\"Error: repository %s/%s doesn't exist\", project.Owner, project.Name)\n\t\t}\n\t\tutils.Check(err)\n\t}\n\n\towner = repo.Owner.Login\n\tname = repo.Name\n\tif expectWiki {\n\t\tif !repo.HasWiki {\n\t\t\tutils.Check(fmt.Errorf(\"Error: %s/%s doesn't have a wiki\", owner, name))\n\t\t} else {\n\t\t\tname = name + \".wiki\"\n\t\t}\n\t}\n\n\tif !allowPush && allowPrivate {\n\t\tallowPush = repo.Private || repo.Permissions.Push\n\t}\n\n\treturn project.GitURL(name, owner, allowPush)\n}\n","sourceCodeStart":124,"sourceCodeEnd":154,"githubUrl":"https://github.com/mislav/hub/blob/5c547ed804368763064e51f3990851e267e88edd/commands/clone.go#L124-L154","documentation":"In commands/clone.go getCloneURL (called from transformCloneArgs), when cloning with expectWiki set (e.g. `hub clone owner/name.wiki` or wiki flag), the repo lookup shows repo.HasWiki is false. The CLI aborts because a wiki repo only exists on GitHub when the wiki feature is enabled.","triggerScenarios":"Running a wiki clone (expectWiki true) against a repository whose GitHub wiki feature is disabled (repo.HasWiki == false).","commonSituations":"Typing `hub clone user/repo.wiki` for a repo that never enabled its wiki; a project disabled the wiki after you had cloned it before; private repos with wiki disabled; misspelling the target so you hit a repo without a wiki.","solutions":["Enable the wiki on the repository: GitHub web UI -> Settings -> Features -> Wikis (Add a wiki).","If you meant the main repo, drop the `.wiki` suffix: `hub clone user/repo`.","Verify the repo slug is correct; a typo may point at a different repo without a wiki."],"exampleFix":"// before\nhub clone user/repo.wiki   // Error: user/repo doesn't have a wiki\n// after\n# enable Wikis in repo Settings on github.com, then:\nhub clone user/repo.wiki","handlingStrategy":"validation","validationCode":"// check wiki availability before cloning\nrepo, err := gh.Repository(github.NewProject(\"user\", \"repo\", \"\"))\nif err != nil { return err }\nif !repo.HasWiki {\n    return fmt.Errorf(\"wiki is not enabled for %s/%s\", \"user\", \"repo\")\n}","typeGuard":null,"tryCatchPattern":"if err := utils.Check(...); /* CLI exits; in library form */ if err != nil && strings.Contains(err.Error(), \"doesn't have a wiki\") { /* fall back to cloning the main repo */ }","preventionTips":["Enable the wiki in repo settings before scripting `.wiki` clones","Verify the slug ends in `.wiki` only when the target has a wiki","Check repo.HasWiki via the API before attempting wiki operations"],"tags":["cli","git","wiki","clone"],"backgroundTag":"repository-wiki-not-enabled","analyzedSha":"5c547ed804368763064e51f3990851e267e88edd","analyzedAt":"2026-09-01T03:34:15.525Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}