Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send pull request from my fork to another fork?

Tags:

git

github

I forked a repository R as R1. Then I make some changes to R1.

B forked the repository R as R2, and R2 becomes the mainly maintained repository.

Now I want to send pull request to R2, how to do?

And what if I want to keep my R1 updated with R2?

like image 559
wenlong Avatar asked Dec 23 '11 08:12

wenlong


People also ask

How do you pull changes from one fork to another?

To pull down (i.e. copy) the changes merged into your fork, you can use the Terminal and the git pull command. To begin: On your local computer, navigate to your forked repo directory. Once you have changed directories to the forked repo directory, run the command git pull .

Can you fork a forked repository?

In this model, you fork the project repository to your own account using the GitHub website. You can then clone the forked repository to your desktop as you would any other repo. Typically you would create a working branch on the local copy of the repo, edit the documents, then push the changes to GitHub.


1 Answers

To send pull request to R2 you can click Pull Request on R1 (your own fork) page, then Edit and choose R2 repository in base fork section.

To pull updates from R2 and push them to your R1 repository you can add new remote for R2 like that:

git remote add r2 git://github.com/<path-to-r2-on-github>.git

Then you can pull changes from r2/master to your local master like that:

git checkout master # checkout your local master
git pull r2 master  # pull changes from master branch of r2 remote repository

And then push them to your R1 (I assume you have R1 configured as origin remote):

git push origin master # push changes (that you previously pulled from r2) 
                       # from local master to master in R1 repository
like image 148
KL-7 Avatar answered Oct 02 '22 20:10

KL-7