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
?
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 .
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With