Hub: pull-request without fork

Created on 6 Nov 2013  Â·  11Comments  Â·  Source: github/hub

Should be possible create a pull-request without a new fork

Most helpful comment

@skywinder It's only possible to open a pull request without a fork if you have push access to the original repository. Then you can simply push to a new branch in that repo and use hub pull-request.

In other cases, you must create a fork with hub fork and push to the new remote git push -u skywinder HEAD and open a pull request hub pull-request.

All 11 comments

Good idea. If you don't have push access to the original repo, a fork could automatically get created for you

Actually you can do this already. I just tried and this works

git pull-request "pull request comment" -b repo_owner:master -h repo_owner:Chapter3

@j1z0 But that requires you to have push rights to the original repo, right?

Yeah it sure does. If you don't push rights you have to use a fork because the permissions in GitHub are per repo not per branch.

Cheers,
Jeremy

On 13 Nov, 2013, at 22:58, Mislav Marohnić [email protected] wrote:

@j1z0 But that requires you to have push rights to the original repo, right?

—
Reply to this email directly or view it on GitHub.

I have the same issue. I want to create a PR directly under a repo that I have commit rights to, and it seems pointless to have to type -b .... -h .... every time. It's quicker to just use the website. :no_good:

AFAIK GitHub.com allows creating pull requests which are from one from fork to another, no matter if you have access to any of them.

Thanks for all your comments. I've decided that this is a dup of #158, so follow that one for updates.

@mislav Hi. I read the #158 and commit message 06999d9, that closes that issue, but didn't find answer to the question: is it possible to "pull-request without fork"?

@skywinder It's only possible to open a pull request without a fork if you have push access to the original repository. Then you can simply push to a new branch in that repo and use hub pull-request.

In other cases, you must create a fork with hub fork and push to the new remote git push -u skywinder HEAD and open a pull request hub pull-request.

@mislav Thanks for explanation!

so as a one liner:
alias github-pull-request="hub fork;git push -u $GIT_USER HEAD;hub pull-request"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dsifford picture dsifford  Â·  4Comments

cschwendiman picture cschwendiman  Â·  4Comments

segevfiner picture segevfiner  Â·  4Comments

DennisSchiefer picture DennisSchiefer  Â·  4Comments

stsewd picture stsewd  Â·  4Comments