1

Some time ago I have forked a repository B which is a fork of another repository A on github. Let's assume, that my forked repository is C.
Now I wanted to contribute directly to repository A.
Therefore I wanted to fork repository A, but instead of creating a new fork (e.g. D), github brings me to my previously created repository C.
I don't want to delete repository C, but I need to start working on my new changes related directly to A.
How can I do it?

Update
I have found a very similar question: How can I fork the original repo when I've already forked a different fork. However I have a problem which is not answered in answers to the above question.

The "intermediate fork" - B does not contain all branches from the original A. Assuming, that I keep working on C and just create a new branch, I don't know how could I base my new branch on a branch of A which is not included in B?

Community
  • 1
  • 1
wzab
  • 788
  • 7
  • 24

1 Answers1

1

I'm afraid you have to add another remote (manually) what's not so hard as you just copy/adjust a line in your git config.

Fetch all and rebase properly. When sending your pull request make sure you send it to the upstream fork.

Jan
  • 1,042
  • 8
  • 22
  • I hope that the above operation can be done "per branch", so that I can have one branch based directly to the A repository and my old branch still based on the B repository? – wzab Dec 26 '13 at 17:07
  • Of course, rebase actually creates a new set of commits, so as long as you keep a reference to the original branch (e.g. creating another branch just there) you will have both, the rebased and the original set of commits. – Jan Dec 26 '13 at 20:14