THE GITHTML FIELD GUIDE

Rename a GitHub repository and update dependent references

GitHub redirects many repository links and Git operations after a repository rename, but you should still update local remotes and dependent references to the new canonical name. Project-site URLs and some specialized consumers need separate attention. Verify the exact repository before renaming, and avoid reusing the old name because that can break redirects.

Inventory references before changing the name

Repository names appear in clone URLs, installation instructions, issue links, badges, package metadata, deployment settings, and external tools. GitHub’s redirects help continuity for many repository operations, but they are not a universal guarantee for every external service or hosted site. List the important consumers and assign a verification owner for each.

A rename changes the repository path under the same owner; a transfer changes ownership. Keep those operations separate unless a planned migration deliberately includes both. Confirm administrative authority and the intended new name, and check whether branding or package identifiers also need changes through their own systems. Renaming the repository does not automatically rename a package distributed elsewhere.

Update clones to the verified canonical URL

After the authorized rename, copy the new clone URL from the repository page. Inspect the existing fetch and push URLs before updating them. A separately configured push URL may need its own review. The example changes origin only after confirming it should follow the renamed repository.

  1. Update contributor instructions and important external links even when the old address redirects, reducing ambiguity for new users and support requests.
  2. Check hosted project-site addresses and external deployment integrations separately; repository redirects do not prove those consumers retain the same behavior.
shell
git remote -v
git remote set-url origin https://github.com/OWNER/NEW-NAME.git
git remote -v
git ls-remote origin

Preserve redirect continuity and verify consumers

GitHub warns against creating another repository with the old name because that can stop the redirect to the renamed project. Record the old name as reserved in your internal migration notes when continuity matters. Do not use successful access through one old issue link as proof that every old reference remains safe indefinitely.

Verify a read operation from an updated clone, inspect key repository pages, and check the external consumers identified before the rename. Existing local folder names do not need to match the repository name, so avoid unnecessary filesystem moves that could disrupt tools. The migration is successful when the new canonical identity is clear and important consumers have been tested, not merely when the settings page displays the new spelling.

  1. If a package manifest or dependency declaration includes the old repository URL, distinguish its informational homepage field from a URL used to retrieve code. Both deserve review, but only the latter directly affects installation. Test the relevant consumer rather than assuming that updating a README covers every reference.
  2. After updating origin, check for other remote aliases that intentionally reference the same renamed repository. A secondary upstream alias can retain the old address while origin points to a fork. Update only aliases whose destinations changed, preserving the distinction between the original project and contribution repositories.

Sources and further reading

AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.

All github documentation workflows guides →

Read as MarkdownAll guides

Rename a GitHub repository and update dependent references · gitHtml