Skip to content

gh repo clone doesn't use canonical capitalisation for remote URL #1845

Closed

Description

@keysmashes

Describe the bug

If you clone e.g. https://github.com/HackSoc/uno by typing gh repo clone hacksoc/uno, then the remote URL will refer to hacksoc/uno.git when it should be capitalised as HackSoc/uno.git. This means that GitHub will complain at you when you push:

remote: This repository moved. Please use the new location:
remote:   [email protected]:HackSoc/uno.git
$ gh --version
gh version 1.0.0 (2020-09-16)
https://github.com/cli/cli/releases/tag/v1.0.0

Steps to reproduce the behavior

  1. Clone a repo via gh repo clone with uncanonical capitalisation
  2. Observe that the remote that gets configured has the same uncanonical capitalisation

Expected vs actual behavior

gh should use the canonical capitalisation for remote URLs, regardless of the capitalisation used in the shorthand username/repo input.

Activity

  1. added
    bug
    on Sep 19, 2020
  2. mislav commented on Sep 21, 2020

    @mislav
    Contributor

    Excellent point. Thank you!

  3. added
    priority-3
    and removed on Sep 29, 2020
  4. added a commit that references this issue on Oct 12, 2020
    487b62d
  5. jonathanlloyd commented on Oct 12, 2020

    @jonathanlloyd
    Contributor

    Hey, I've had a go at this in #2177 - let me know what you think 😄
    Happy Hacktoberfest! 🎃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions