github:转移所有权和分叉

github: transfer ownership and fork

我已将我的 github 个存储库 (rdmuller/docToolchain) 之一的所有权转让给一个组织 (docToolchain/docToolchain)。 到目前为止,一切都很好。所有旧 URL 都被重定向到新位置。完美。

但是我现在如何 fork 这个存储库?我担心,如果我分叉它,将创建一个使用旧存储库 (rdmueller/docToolchain) 名称的分叉,并且重定向将以这种方式中断...

我怎样才能避免这种情况?

所以,我想我找到了解决方法。

假设您有一个存储库

user1/repo1

您现在想要将所有权转让给 org1 并在您的帐户 user1 中创建它的分支 user1

问题是,如果您直接创建这个分支,将再次有一个名为 user1/repo1 的存储库,并且 github 无法将旧存储库的 URL 重定向到 org1/repo1

解决方案:

  • 将所有权从 user1/repo1 转移到 org1/repo1
  • 创建临时组织org2
  • 分叉 org1/repo1org2/repo1
  • org2/repo1 重命名为 org2/repo1-fork
  • 将所有权从 org2/repo1-fork 转移到 user1/repo1-fork

这似乎可以解决问题。

自 2020 年 5 月以来,Ben Balter (Senior Product Manager working on Community and Safety at @GitHub) mentions in his tweet

We're beta testing a new GitHub feature that allows you to invite someone to manage your open source projects in the event that you are unable able to do so yourself.

If you'd like early access, reply or DM with your GitHub handle and I can add you.

参见“Maintaining ownership continuity of your user account's repositories

You can invite someone to manage your user owned repositories if you are not able to.

We recommend inviting another GitHub user to be your successor, to manage your user owned repositories if you cannot. As a successor, they will have permission to:

  • Archive your public repositories.
  • Transfer your public repositories to their own user owned account.
  • Transfer your public repositories to an organization where they can create repositories.