简体   繁体   English

当原始引用我的时,删除GitHub仓库的分支是否安全?

[英]Is it safe to delete a fork of a GitHub repo, when the original refers to mine?

Background: I have a situation similar to this but the solution there doesn't solve my problem. 背景:我有类似的情况但那里的解决方案并没有解决我的问题。 On GitHub I forked a fork of a project: 在GitHub上,我分叉了一个项目的分支:

Original -> SomeonesFork -> MyFork

I forked from SomeonesFork in order to clean up some changes they had made and send a pull request back to the original repo. 我从SomeonesFork分叉,以便清理他们所做的一些更改,并将拉取请求发送回原始仓库。 Since then I have also sent to pull requests direct to the original which were accepted. 从那时起,我也发送了直接提取请求的原始请求。

However, I would prefer my repo to be a direct fork of the Original instead of having the SomeonesFork intermediary. 但是,我更喜欢我的repo是Original的直接分支而不是SomeonesFork中介。 (Makes things much easier on GitHub.) I set the original as the upstream and pushed to my fork, but GitHub still says it's a fork of SomeonesFork. (在GitHub上让事情变得更容易。)我将原始设置为上游并推送到我的分支,但GitHub仍然说它是SomeonesFork的分支。

If I try to fork the original again I just get sent to the one that already exists. 如果我再次尝试分割原件,我就会被发送到已经存在的那个。 From research it looks like GH doesn't allow multiple forks. 从研究来看,GH看起来不允许多个叉子。

So my question is: is it safe to simply delete the fork I have right now, then re-fork the original? 所以我的问题是:简单地删除我现在拥有的fork是否安全,然后重新分叉原始? Does this cause problems in git or GitHub anywhere? 这会导致git或GitHub在任何地方出现问题吗?

Git is a distributed system and there is a copy of all the code in all repos that the code has been committed or pushed into. Git是一个分布式系统,并且代码已经提交或推送到的所有存储库中都有所有代码的副本。 References between repositories are minimal text flags that mention where a merge commit came from. 存储库之间的引用是最小的文本标志,提到合并提交的来源。 There is no real link between them. 他们之间没有真正的联系。

I have deleted many forks on github in the past with no ill effects. 我过去在github上删除了许多分叉,没有任何不良影响。 The pull request is "sent" to the repo owner as a patch file. 拉取请求作为补丁文件“发送”到repo所有者。 Just try sticking .patch onto the end of any pull request or commit URL on github to see the patch file contents in plain text. 只需尝试将.patch粘贴到github上的任何拉取请求或提交URL的末尾,以纯文本形式查看补丁文件内容。 Here is one that someone else requested against a project I maintain: https://github.com/j4mie/paris/pull/35.patch 以下是其他人对我维护的项目请求的内容: https//github.com/j4mie/paris/pull/35.patch

Therefore it is self contained and you deleting your fork won't effect the availability of this patch to the upstream repo owner. 因此它是自包含的,并且删除fork不会影响此修补程序对上游repo所有者的可用性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM