mislav/hub · error

Error: %s/%s doesn't have a wiki

Error message

Error: %s/%s doesn't have a wiki

What it means

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.

Source

Thrown at commands/clone.go:142

	if expectWiki {
		name = strings.TrimSuffix(name, ".wiki")
	}

	project := github.NewProject(owner, name, hostStr)
	gh := github.NewClient(project.Host)
	repo, err := gh.Repository(project)
	if err != nil {
		if strings.Contains(err.Error(), "HTTP 404") {
			err = fmt.Errorf("Error: repository %s/%s doesn't exist", project.Owner, project.Name)
		}
		utils.Check(err)
	}

	owner = repo.Owner.Login
	name = repo.Name
	if expectWiki {
		if !repo.HasWiki {
			utils.Check(fmt.Errorf("Error: %s/%s doesn't have a wiki", owner, name))
		} else {
			name = name + ".wiki"
		}
	}

	if !allowPush && allowPrivate {
		allowPush = repo.Private || repo.Permissions.Push
	}

	return project.GitURL(name, owner, allowPush)
}

View on GitHub (pinned to 5c547ed804)

Solutions

  1. Enable the wiki on the repository: GitHub web UI -> Settings -> Features -> Wikis (Add a wiki).
  2. If you meant the main repo, drop the `.wiki` suffix: `hub clone user/repo`.
  3. Verify the repo slug is correct; a typo may point at a different repo without a wiki.

Example fix

// before
hub clone user/repo.wiki   // Error: user/repo doesn't have a wiki
// after
# enable Wikis in repo Settings on github.com, then:
hub clone user/repo.wiki
Defensive patterns

Strategy: validation

Validate before calling

// check wiki availability before cloning
repo, err := gh.Repository(github.NewProject("user", "repo", ""))
if err != nil { return err }
if !repo.HasWiki {
    return fmt.Errorf("wiki is not enabled for %s/%s", "user", "repo")
}

Try / catch

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 */ }

Prevention

When it happens

Trigger: Running a wiki clone (expectWiki true) against a repository whose GitHub wiki feature is disabled (repo.HasWiki == false).

Common situations: 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.

Related errors


AI-assisted analysis of mislav/hub@5c547ed804 (2026-09-01). Data as JSON: /api/errors/49308d6349891ae3. Report an issue: GitHub.