Skip to content

use_github() fails with "Repo already exists" after renaming a repo #1893

@ateucher

Description

@ateucher

If I create a repo on GitHub, then rename it and then try to use use_github() with the old name, it errors with "Repo [reponame] already exists on 'github.com'", even though that name should be now be available after the renaming.

To reproduce:

On GitHub:

  1. Create a repo (called for example "test123")
  2. Rename the repo to "test123.old"

Locally:

  1. create_project("~/Desktop/test123")
  2. use_git() (accept all the prompts)
  3. use_github() - this gives:
    ℹ Defaulting to 'https' Git protocol
    ✔ Setting active project to '/Users/andy/dev/test123'
    Error: Repo 'ateucher/test123' already exists on 'github.com'
    

This occurs because of the redirect that GitHub does on renamed repos, so the API call in check_no_github_repo() here does not fail because it finds the renamed repo (test123.old).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorgitgit, GitHub, and CI in general

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions