本文介绍了github:转让所有权和分叉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've transfered ownership of one of my github repositories (rdmuller/docToolchain) to an organisation (docToolchain/docToolchain).So far, so good. All old URLs are redirected to the new location. Perfect.

但是我现在该如何存储此存储库?我担心,如果我进行分叉,则会创建一个具有旧存储库名称的分叉(rdmueller/docToolchain),并且重定向将以这种方式被破坏...

But how do I now fork this repository? I fear that, if I fork it, a fork with the name of the old repository (rdmueller/docToolchain) will be created and the redirect will be broken this way...

如何避免这种情况?

推荐答案

所以,我想我找到了一种解决方法.

So, I guess I found a workaround.

假设您有一个存储库

user1/repo1

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

You now want to transfer ownership to org1 and create a fork of it in your account user1.

问题在于,如果直接创建此fork,将再次有一个名为user1/repo1的存储库,并且github无法将URL重定向到旧存储库中的org1/repo1

The problem is that, if you create this fork directly, there will be again a repo called user1/repo1 and github is not able to redirect URLs to the old repository to org1/repo1

解决方案:

  • 将所有权从user1/repo1转移到org1/repo1
  • 创建一个临时组织org2
  • org1/repo1叉到org2/repo1
  • org2/repo1重命名为org2/repo1-fork
  • 将所有权从org2/repo1-fork转移到user1/repo1-fork
  • transfer ownership from user1/repo1 to org1/repo1
  • create a temporary organisation org2
  • fork org1/repo1 to org2/repo1
  • rename org2/repo1 to something like org2/repo1-fork
  • transfer ownership from org2/repo1-fork to user1/repo1-fork

这似乎可以解决问题.

这篇关于github:转让所有权和分叉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 05:49