我在 github 上有一个存储库。我的存储库是由另一个用户分叉的。现在他提出了拉取请求。我想将一个提交从我的一端推送到他的功能分支(他已为此提出了 PR)。这可能吗。
这是我所做的
git pull remote-ref-other-user feature-branch
完成此操作后,我可以拉取他的提交。但是当我做一些更改时,添加另一个提交并尝试以这种方式推送它。
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'
是否可以将提交从我这边推送到他的分支。如果是的话该怎么办呢。
假设您添加他的存储库(例如“mysamplerepository”)作为远程存储库:
git remote add johnrepo https://github.com/john/mysamplerepository
你的分支叫tweaks
.
如果您想将更改推送到名为的分支master
在他的存储库中,你会这样做:
git push <remote-name> <source-ref>:<target-ref>
或者在这个例子中:
git push johnrepo refs/heads/tweaks:refs/heads/master
请记住,您还需要具有写入权限(推送访问权限)才能推送到他的存储库。您可以阅读有关此内容的更多信息Github 的文档 https://help.github.com/articles/permission-levels-for-a-user-account-repository/.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)