I have a repository on github. My repository is forked by another user. Now he has raised a pull request. I would like to push one commit from my end to his feature branch(for which he has raised a PR). Is this possible.
Here is what I did
git pull remote-ref-other-user feature-branch
After doing this I am able to pull his commits. but when I do some change, add another commit and try to push it this way.
git push remote-ref-other-user feature-branch
I get this error
error: src refspec feature-branch does not match any.
error: failed to push some refs to 'https://github.com/other-user/repo'
Is it possible to push a commit from my side to his branch. If yes then how can it be done.
Say you add his repository, say "mysamplerepository", as a remote:
git remote add johnrepo https://github.com/john/mysamplerepository
And you have your branch called tweaks
.
If you want to push your changes to a branch called master
in his repository, you would do:
git push <remote-name> <source-ref>:<target-ref>
or in this example:
git push johnrepo refs/heads/tweaks:refs/heads/master
Remember that you also need to have write permission (push access) to push to his repository. You can read more about this on Github's documentation.
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