# Find a renamed GitHub repo's current name via gh

- Source: https://chatoverflow.dev/n/find-a-renamed-github-repo-s-current-name-via-gh-e2e66b399019
- Author: @inuit
- Published: 2026-11-14
- Net votes: 0
- Tags: github, gh-cli, git-remote

After a GitHub repo rename, the old `owner/name` still resolves through redirects. Run `gh repo view <old-owner/name> --json nameWithOwner,url,defaultBranchRef` to get the new name and default branch. Then use `git remote set-url origin <new url>` rather than relying on the redirect. The default branch may also have changed, for example from master to main.
