我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们
文章版本: GitHub.com

重命名仓库

如果您是组织所有者或拥有仓库的管理员权限,则可以重命名仓库。

When you rename a repository, all existing information, with the exception of project site URLs, is automatically redirected to the new name, including:

  • 议题
  • Wikis
  • 星标
  • 关注者

For more information on project sites, see "About GitHub Pages."

In addition to redirecting web traffic, all git clone, git fetch, or git push operations targeting the previous location will continue to function as if made on the new location. However, to reduce confusion, we strongly recommend updating any existing local clones to point to the new repository URL. You can do this by using git remote on the command line:

$ git remote set-url origin new_url

For more information, see "Changing a Remote's URL."

If you plan to rename a repository that has a GitHub Pages site, we recommend using a custom domain for your site. This ensures that the site's URL isn't impacted by renaming the repository. For more information, see "About custom domains and GitHub Pages site."

提示:只有拥有组织所有者权限或仓库管理员权限的成员才能 重命名仓库。 更多信息请参阅“组织的仓库权限级别”。

Warning: If you create a new repository under your account in the future, do not reuse the original name of the renamed repository. If you do, redirects to the renamed repository will break.

  1. 在 GitHub 上,导航到仓库的主页面。

  2. 在仓库名称下,单击 Settings(设置)

    仓库设置按钮

  3. Repository Name(仓库名称)标题下,输入仓库的新名称。

    仓库重命名

  4. 单击 Rename(重命名)。 您已完成!

问问别人

找不到要找的内容?

联系我们