Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

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. 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. (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.

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.

So my question is: is it safe to simply delete the fork I have right now, then re-fork the original? Does this cause problems in git or GitHub anywhere?

like image 499
DisgruntledGoat Avatar asked Jan 02 '13 15:01

DisgruntledGoat


1 Answers

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. 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. The pull request is "sent" to the repo owner as a patch file. 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. Here is one that someone else requested against a project I maintain: 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.

like image 50
Treffynnon Avatar answered Oct 20 '22 10:10

Treffynnon