将提交推送到已打开拉取请求的另一个用户的分支 [英] Pushing a commit to branch of another user who has opened a pull request

查看:93
本文介绍了将提交推送到已打开拉取请求的另一个用户的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在github上有一个存储库。我的存储库由另一个用户分叉。现在,他提出了拉取请求。我想将一次提交从我的末端推到他的功能分支(为此他已经提出了PR)。这可能吗。

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.

这是我所做的

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

我收到此错误

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.


推荐答案

说您添加他的存储库,说 mysamplerepository,作为远程​​服务器:

Say you add his repository, say "mysamplerepository", as a remote:

git remote add johnrepo https://github.com/john/mysamplerepository

您有一个名为 tweaks 的分支。

如果要将更改推送到其存储库中名为 master 的分支中,则可以执行以下操作:

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>

或在此示例中:

git push johnrepo refs / heads / tweaks:refs / heads / master

记住还需要具有写权限(推送访问)才能推送到他的存储库。您可以在 Github的文档中阅读有关此内容的更多信息

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.

这篇关于将提交推送到已打开拉取请求的另一个用户的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆