自动开启通过命令行上github上拉的请求 [英] Automatically open a pull request on github by command line

查看:389
本文介绍了自动开启通过命令行上github上拉的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用GIT中版本一个协作项目。

和我有两个遥控器。 项目原产地是原来的项目。

的叉子

所以,我能当我发送一推(混帐推叉主)自动创建一个拉请求提供的原产地合并呢?

我不能直接承诺的原产地(我知道这是可能的)。我需要先推到,如果管理员aproves它,接受的原产地。我想这个过程自动化,避免我手动去github上,并打开一个叉。

我怎么能这样做呢?

编辑:

私人组织:

 名称:组织
库:主要
分支:主

私人叉:

 名称:OrgFork(我用叉子一个组织从** **组织)
库:主要
分支:测试

我尝试以下方法,但还没有工作:

 卷曲-X POST -u<用户名> -k -d{称号:<标题>中,头:组织:主要的,基本:测试}'https://api.github.com/repos/Org/主/拉

什么是错的?我该如何解决这个问题?

编辑2

另一种尝试:

 枢纽拉请求测试-b OrgFork:主营:测试-h OrgFork:主:主


解决方案

最后成功

第一个问题是,我用钥匙密码,而不是我的github上的密码。

通过这种结构:

私人组织:

 名称:组织
库:主要
分支:主

私人叉:

 名称:OrgFork(我用叉子一个组织从** **组织)
库:主要
分支:测试

和其他的问题是我需要接受参数进行校正,最后的命令看起来像这样的:

 枢纽拉请求测试拉请求-b组织:主-h OrgFork:测试

THX求救@ cjc343,@StevenPenny,@ desert69 =)

I'm using git to versioning a collaborate project.

And I have two remotes. fork is a fork of an project, and origin is the original project.

So, could I when I send a push (git push fork master) automatically create a pull request available in origin to merge it?

I can't commit directly to origin (I know this is possible). I need push first to fork and if the admin aproves it, accept on origin. I would like automate this process, avoiding me to manually go to github and open a fork.

How could I do this?

Edit:

Private Organization:

name: Org
repository: main
branch: master

Private Fork:

name: OrgFork (A organization of mine with forks from **Org**) 
repository: main
branch: testing

I tried the following approach, but didn't worked yet:

curl -X POST -u <Username> -k -d '{"title": "<Title>","head": "Org:main","base": "testing"}' https://api.github.com/repos/Org/main/pulls

what is wrong? How can I fix this?

Edit 2

Another attempt:

hub pull-request "Testing" -b OrgFork:main:testing -h OrgFork:main:master

解决方案

Finally success

The first problem is that I was using the key password and not my github password.

With this structure:

Private Organization:

name: Org
repository: main
branch: master

Private Fork:

name: OrgFork (A organization of mine with forks from **Org**) 
repository: main
branch: testing

And the other problem is I was needing accept the corrects parameters, the final command looks like this one:

hub pull-request "Testing pull-request" -b Org:master -h OrgFork:testing

Thx for help @cjc343, @StevenPenny, @desert69 =)

这篇关于自动开启通过命令行上github上拉的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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