Add Repository A as a remote to your local repository:
git remote add repo-a <url>
git fetch repo-a
Create your own branch based on the branch you should open a pull request against. This is conventionally master
, but check the README
or CONTRIBUTING
files for instructions.
git checkout -b my-feature repo-a/master
Now, you're on a branch called my-feature
(name this for what you've done). Use cherry-pick
to get the commit you made onto this branch where <hash>
is the hash of your commit:
git cherry-pick <hash>
You now have a local branch ready for a pull request. Push that branch to your fork to publish it (assuming origin
is the name of the remote for your fork):
git push origin my-feature
You can now open a pull request from my-feature
on your fork to master
in Repository A.