76

I am currently working on a project that is a spinoff (fork) from a framework I have been working on.

This project is intended to be pretty generic, but now I need to fork the codebase again for a client of mine.

At this moment, I have created a custom branch for my client, but I'd rather have a standalone repository for this.

  • Is is possible to 'fork a fork'?
  • If not, what alternatives do I have?

Outline of the situation:

  • Framework repository (original)
    • Generic application repository (fork)
      • (not yet) Client repository (fork of application)

Note: when trying to 'fork a fork' in Github, you will receive a notification that you have already forked the project:

Image showing a forked project cannot be forked again

Nate Eldredge
  • 48,811
  • 6
  • 54
  • 82
Aron Rotteveel
  • 81,193
  • 17
  • 104
  • 128
  • I don't see why it should not be possible... have you tried it? – Felix Kling Jul 13 '11 at 08:20
  • @Felix ah, perhaps I should have clarified that. It is not possible. Updated post to reflect this. – Aron Rotteveel Jul 13 '11 at 08:21
  • Oh ok ( :( ). Is it important that the project is also known to GitHub as a fork (maybe because of pull requests..)? Otherwise you might be able to clone their "real" repository and add it as GitHub project later... – Felix Kling Jul 13 '11 at 08:23
  • @Felix I thought of that. Could be a possible alternative, yeah. I'd still prefer the entire fork history to be preserved, though. – Aron Rotteveel Jul 13 '11 at 08:24
  • I see... in any way, I suggest to contact GitHub support (if you haven't done so yet). – Felix Kling Jul 13 '11 at 08:26
  • Ahh... it seems your problem is a different one. Do you want to create a fork of your own project? Or do you want to create a second fork from a project? (Because forking a fork in general is possible). – Felix Kling Jul 13 '11 at 08:32
  • I don't know it will be a correct alternatives, because it's depend on your framework. If your generic application not modifying your framework, your framework should be a submodule of your application instead of forking/cloning it. With submodule-ing it, you are keeping the project separated, but still the same. – dieend Mar 07 '13 at 03:39
  • This may be a silly question, but have you considered putting the forked fork simply into branches with a `forke2/` prefix? – Tobias Kienzler Apr 26 '18 at 17:37
  • I have the same problem I already fork the main project., But now there is a fork of the main project (by another user) with a branch that i want to use and if I try to fork from this branch/fork it just takes me to my original fork of the main project. – Paul Taylor Feb 28 '20 at 11:17

4 Answers4

47

This is now very possible. You just go to the fork you want to fork and click "fork" like you would always do. This only works if you don't have a different fork of that repository in your account already, though. If you do, you have to delete it.

Answered in a comment by iFreilicht

Since this is the correct answer now, it is better to highlight it.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Jigar
  • 8,762
  • 6
  • 25
  • 26
  • 20
    This is not a correct answer, since the person doesn't want to delete his original repository someone made a fork of, he/she now wants again to fork with their modifications. – axkibe Feb 16 '17 at 12:41
38

I contacted GitHub support about this 'issue' and they confirmed this is not possible. Also, it is very unlikely that such a feature will be implemented in the future.

teobais
  • 2,820
  • 1
  • 24
  • 36
Aron Rotteveel
  • 81,193
  • 17
  • 104
  • 128
  • 9
    We have a solid scenario where this feature is *required*. In 2015: Is Github still insistent on not supporting this use case? – WestCoastProjects Aug 18 '15 at 18:20
  • 10
    This is now very possible. You just go to the fork you want to fork and click "fork" like you would always do. This only works if you don't have a different fork of that repository in your account already, though. If you do, you have to delete it. Here's an example: https://github.com/tmk/tmk_keyboard/network/members – iFreilicht Aug 14 '16 at 11:10
  • 7
    They ought to support having both a fork of the original repo and a fork of a fork, simultaneously. They only need to keep track of the parent repo id for it to work. – Andrew Oct 27 '17 at 21:43
  • 7
    It's still not possible, two years later. I've been running into the same issue, today. In my case the original project is dead, so it's ok to create a clone of the original project that I still need for maintenance. But what if I wanted to contribute to two forks of the same project? – Peter Gloor Aug 13 '19 at 08:42
  • 5
    Same issue. This is very questionable design at best and doesn't make sense at all. – Shital Shah Nov 01 '19 at 07:29
  • After 3 years it still is not possible. Renaming a forked repo won't help either. – Andry Sep 07 '22 at 15:06
7

Simple answer: Yes and no.

No, for a single account as you are unable to create two repositories with the same name (and forks always have the same name).

Yes, for multiple accounts. So you could setup an organization for your second fork.

Koraktor
  • 41,357
  • 10
  • 69
  • 99
  • @Korakter that seems to be the problem: the original project is personal, the fork is organizational. The third one *should* be organizational... – Aron Rotteveel Jul 13 '11 at 08:40
  • 1
    Don't see a problem: As long as the second and third repo goes into different organizations, it works. – KingCrunch Jul 13 '11 at 08:54
  • That still is the problem though; I'd rather not create another organization account for this, since it is technically still the same organization, and these are paid accounts. – Aron Rotteveel Jul 13 '11 at 11:43
  • 2
    You should use branches then, not forks. – Tekkub Jul 14 '11 at 19:49
  • @Koraktor: "unable to create two repositories with the same name (and forks always have the same name)." Couldn't you rename the repository in Admin > Settings > Repository Name? – XP1 Sep 18 '11 at 17:19
  • "forks always have the same name" - so this should work if you rename the first fork. But renaming (as suggested by @XP1) does not seem to be enough to create a new fork. – Vineet Dec 07 '11 at 23:52
0

now,there is a drop-down arrow, you can chose base repository drop-down arrow

user2352151
  • 81
  • 1
  • 5