Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the source of a Github fork?

I forked a project on Github from source A. Since then, the standard practice is to issue pull requests not to A, but to B. That means every pull request, I have to manually specify the destination of the pull request - a bit tedious.

Is there a way to permanently change the source of my fork?

like image 503
Steve Bennett Avatar asked Mar 10 '12 04:03

Steve Bennett


1 Answers

I didn't find it at first, but one workaround would be to make another fork, this time from source B, and:

  • clone that new fork.
  • add your initial local clone as a remote
  • fetch from your first local clone, in order to get all your current work
  • push your work to the second fork

At least, this second fork will have the right destination for all pull requests.

Note: the OP Steve Bennett reminds us that:

Github won't allow you to fork the same repository twice.
(That is, you fork A to make C, then someone else forks A to make B - you can't fork C to make D. You get the "Your Fork" button)

So I suggests to do that second fork under another account.

You can manage multiple accounts from your local clones, and that would allow you to bypass the GitHub limitation on multiple forks.

like image 103
VonC Avatar answered Oct 02 '22 16:10

VonC