此版本的 GitHub Enterprise 将停止服务 2022-02-16. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持

Transferring a repository

You can transfer repositories to other users or organization accounts.

About repository transfers

When you transfer a repository to a new owner, they can immediately administer the repository's contents, issues, pull requests, releases, project boards, and settings.

Prerequisites for repository transfers:

  • When you transfer a repository that you own to another user account, the new owner will receive a confirmation email.
  • To transfer a repository that you own to an organization, you must have permission to create a repository in the target organization.
  • The target account must not have a repository with the same name, or a fork in the same network.
  • The original owner of the repository is added as a collaborator on the transferred repository. Other collaborators to the transferred repository remain intact.
  • Internal repositories can't be transferred.
  • Private forks can't be transferred.

What's transferred with a repository?

When you transfer a repository, its issues, pull requests, wiki, stars, and watchers are also transferred. If the transferred repository contains webhooks, services, secrets, or deploy keys, they will remain associated after the transfer is complete. Git information about commits, including contributions, is preserved. In addition:

  • If the transferred repository is a fork, then it remains associated with the upstream repository.

  • If the transferred repository has any forks, then those forks will remain associated with the repository after the transfer is complete.

  • If the transferred repository uses Git Large File Storage, all Git LFS objects are automatically moved. This transfer occurs in the background, so if you have a large number of Git LFS objects or if the Git LFS objects themselves are large, it may take some time for the transfer to occur.

  • When a repository is transferred between two user accounts, issue assignments are left intact. When you transfer a repository from a user account to an organization, issues assigned to members in the organization remain intact, and all other issue assignees are cleared. Only owners in the organization are allowed to create new issue assignments. When you transfer a repository from an organization to a user account, only issues assigned to the repository's owner are kept, and all other issue assignees are removed.

  • If the transferred repository contains a GitHub Pages site, then links to the Git repository on the Web and through Git activity are redirected. However, we don't redirect GitHub Pages associated with the repository.

  • All links to the previous repository location are automatically redirected to the new location. When you use git clone, git fetch, or git push on a transferred repository, these commands will redirect to the new repository location or URL. However, to avoid 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
  • When you transfer a repository from an organization to a user account, the repository's read-only collaborators will not be transferred. This is because collaborators can't have read-only access to repositories owned by a user account. For more information about repository permission levels, see "Permission levels for a user account repository" and "Repository roles for an organization."

For more information, see "Managing remote repositories."

Repository transfers and organizations

To transfer repositories to an organization, you must have repository creation permissions in the receiving organization. If organization owners have disabled repository creation by organization members, only organization owners can transfer repositories out of or into the organization.

Once a repository is transferred to an organization, the organization's default repository permission settings and default membership privileges will apply to the transferred repository.

Transferring a repository owned by your user account

You can transfer your repository to any user account that accepts your repository transfer. When a repository is transferred between two user accounts, the original repository owner and collaborators are automatically added as collaborators to the new repository.

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

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

  3. 单击 Transfer(转让)转让按钮

  4. 阅读警告并输入仓库名称以确认您已经这样做。

  5. 输入新所有者的名称,然后单击 I understand, transfer this repo(我了解,转让此仓库)转让按钮

Transferring a repository owned by your organization

If you have owner permissions in an organization or admin permissions to one of its repositories, you can transfer a repository owned by your organization to your user account or to another organization.

  1. Sign into your user account that has admin or owner permissions in the organization that owns the repository.

  2. 在 your GitHub Enterprise Server instance 上,导航到仓库的主页面。

  3. 在仓库名称下,单击 Settings(设置)仓库设置按钮

  4. 单击 Transfer(转让)转让按钮

  5. 阅读警告并输入仓库名称以确认您已经这样做。

  6. 输入新所有者的名称,然后单击 I understand, transfer this repo(我了解,转让此仓库)转让按钮

此文档对您有帮助吗?

隐私政策

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或者, 了解如何参与。