你如何将一个新的pull请求附加到github上的现有问题上? [英] How do you attach a new pull request to an existing issue on github?

查看:98
本文介绍了你如何将一个新的pull请求附加到github上的现有问题上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定,但我有一个模糊的记忆,用标题中的Issue 4或其他内容创建github pull请求,并且它自动附加到我提交给它的项目中的Issue 4。我最近又试了一次,但没有奏效 - 它只是创建了一个全新的问题。我在新的请求页面上看不到任何选项,例如附加问题,也没有在问题页面上显示为此问题打开新的请求。有没有办法做到这一点,以帮助项目业主保持他们的问题页面干净,避免重复?



编辑:澄清,我知道创建拉取请求总是会创建一个新的问题。我希望将拉请求附加到现有问题上。 项目可以这样做:



https://github.com / defnkt / hub



在您想要发送拉取请求的存储库和分支中:

  $ hub pull-request -i 4 

使用GitHub API,并将当前分支的拉取请求附加到现有的发行编号4上。




编辑:评论@atomicules:为了扩展@MichaelMior的答案,一个完整的例子是:

$ $ $ $ $ $ pull-request -i 4 -b USERNAME_OF_UPSTREAM_OWNER:UPSTREAM_BRANCH -h YOUR_USERNAME:YOUR_BRANCH URL_TO_ISSUE


I'm not sure, but I have a vague memory of creating a github pull request with "Issue 4" or something in the title, and it automatically attached itself to Issue 4 in the project that I was submitting it to. I tried it again recently and it didn't work -- it just created a brand new issue instead. I don't see any options like "Attach to issue" on the new pull request page, nor "Open a new pull request for this issue" on the issue page. Is there any way to do this, to help project owners keep their Issues page clean and avoid duplication?

Edit: To clarify, I know that creating a pull request always creates a new issue. I would like to instead attach the pull request to an existing issue.

解决方案

The "hub" project can do this:

https://github.com/defunkt/hub

In the repository and branch that you want to send a pull request from:

$ hub pull-request -i 4

This uses the GitHub API, and attaches a pull request for the current branch to the existing issue number 4.


EDIT: Comment by @atomicules: To expand on the answer by @MichaelMior a full example is:

$ hub pull-request -i 4 -b USERNAME_OF_UPSTREAM_OWNER:UPSTREAM_BRANCH -h YOUR_USERNAME:YOUR_BRANCH URL_TO_ISSUE

这篇关于你如何将一个新的pull请求附加到github上的现有问题上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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