如何在github上推送请求请求? [英] How do I push to a pull request on github?

查看:101
本文介绍了如何在github上推送请求请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将其添加到我的.git/config文件中:

I've added this to my .git/config file:

fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

这允许我下拉请求请求的差异,但是当我签出它时,实际上创建了一个具有相同名称的分支.我有什么办法可以推送到pr/2并使其实际转到请求请求,而不是转到名为pr/2的新分支?

Which allows me to pull down pull request diffs, but when I check it out it actually creates a branch with that same name. Is there any way for me to push to pr/2 and have it actually go to the pull request instead of going to a new branch named pr/2?

推荐答案

拉取请求只是合并特定分支的请求.这意味着在拉取请求打开之后对分支所做的提交将包含在最终的合并中.

A Pull Request is just a request to merge a certain branch. This means commits made to the branch after the pull request is opened will be included in the eventual merge.

如果您有权访问合并请求的分支,则可以提交到该分支,合并请求将随着更改而更新.

If you have access to the branch that the pull request is asking to merge, you can commit to that branch and the pull request will update with the changes.

示例:

pull/3请求将hotfix合并到master

pull/3 is requesting to merge hotfix into master

git fetch
git checkout hotfix
git pull origin hotfix

进行更改

git add .
git commit -m "changes!"
git push origin hotfix

现在,您的提交将显示在拉取请求中.

Now your commit will show up in the pull request.

这篇关于如何在github上推送请求请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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