-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingp3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
Describe the bug
I am using the cli with our internal github enterprise instance. When renaming a repository with the gh repo rename command, the origin's URL is set incorrectly. Regardless of my enterprise URL, it is always set as if I was using github.com
# gh --version
gh version 2.23.0 (2023-02-08)
https://github.com/cli/cli/releases/tag/v2.23.0
Steps to reproduce the behavior
- Make sure that you are only authenticated with a github enterprise URL (or anything that isn't github.com)
- Attempt to rename a repository
- Observe that the origin's url is not set correctly
Expected vs actual behavior
the new origin URL is set to git@github.com:username/newreponame instead of git@github.mycompany.com:username/newreponame
Logs
$ gh auth status
github.mycompany.com
✓ Logged in to github.mycompany.com as matefriedl
✓ Git operations for github.mycompany.com configured to use ssh protocol.
✓ Token: gho_************************************
✓ Token scopes: admin:public_key, gist, read:org, repo
$ gh repo create gh-rename-bug-repro -c --public
✓ Created repository matefriedl/gh-rename-bug-repro on GitHub
$ cd .\gh-rename-bug-repro\
$ git remote -v
origin git@github.mycompany.com:matefriedl/gh-rename-bug-repro.git (fetch)
origin git@github.mycompany.com:matefriedl/gh-rename-bug-repro.git (push)
$ gh repo rename newreponame
? Rename matefriedl/gh-rename-bug-repro to newreponame? Yes
✓ Renamed repository matefriedl/newreponamenewreponame? (y/N) y
✓ Updated the "origin" remote
$ git remote -v
origin git@github.com:matefriedl/newreponame.git (fetch)
origin git@github.com:matefriedl/newreponame.git (push)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic