You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently when you open a pr from a branch, it's pushed into the repo it's originated from.
We only push to the origin repo if you have write access to it in the first place. Is there a use-case where you have write access to the origin repo, but you still don't want to push there?
Also, does this push fail for you right now?
this would fit lots of the workflows in lots of opensource projects when you don't have write-access to the main repo.
When you don't have write access to the main repo, we fork it and push to your fork instead. This all happens by default. If you do not experience that this works, can you tell us more about your setup and paste some error messages?
maybe my workflow is a bit weird or backwards, but it would be nice to have a bit more control when needed.
Your workflow doesn't seem weird at all; thanks for clarifying.
I will close this as duplicate of #350 where people have been requesting the option to indicate their preference that they want to always push to a fork instead of to upstream, even if they have write access.
@casperdcl I understand that this is not an exact duplicate, but in the referenced thread we're discussing a better default for where the branch is pushed, plus we're planning to respect if the branch is already pushed to a specific remote. The combination of those two improvements should make a vast improvement in experience for our users:
gh pr create by default will always push to a fork if one exists - this will be a better default since the considerable majority of users have asked for this. A better default (ideally) means that fewer people will need an option to change it.
git push <remote> HEAD && gh pr create will allow one to choose where the branch is pushed, alleviating the need for --remote flag.
At this moment we're trying to avoid adding too many configuration flags because that could over time prove to be difficult to maintain.
on the other hand, quietly setting defaults without exposing config options is also dangerous. I don't personally mind, but others might. Happy if (2) works:
Activity
mislav commentedon Feb 17, 2020
Thanks for writing in!
We only push to the origin repo if you have write access to it in the first place. Is there a use-case where you have write access to the origin repo, but you still don't want to push there?
Also, does this push fail for you right now?
When you don't have write access to the main repo, we fork it and push to your fork instead. This all happens by default. If you do not experience that this works, can you tell us more about your setup and paste some error messages?
fruch commentedon Feb 17, 2020
I have a fork already, and I have write access to both.
origin is my fork
when I've used
gh pr createfrom a branch created from upstream/master, the branch was pushed to upstream and not into origin as I would like to.fruch commentedon Feb 17, 2020
Some more info, pushing into the upstream in my case, trigger more CI build which. the work flow of the whole team is to work on your own fork.
I've run into it, since after creating the PR, I've pushed updated to my own fork, and not seeing them in the PR.
maybe my workflow is a bit weird or backwards, but it would be nice to have a bit more control when needed.
mislav commentedon Feb 17, 2020
Your workflow doesn't seem weird at all; thanks for clarifying.
I will close this as duplicate of #350 where people have been requesting the option to indicate their preference that they want to always push to a fork instead of to upstream, even if they have write access.
casperdcl commentedon Mar 17, 2020
This isn't a duplicate of #350. #350 is about changing defaults. This (#480) is about exposing an option:
mislav commentedon Mar 17, 2020
@casperdcl I understand that this is not an exact duplicate, but in the referenced thread we're discussing a better default for where the branch is pushed, plus we're planning to respect if the branch is already pushed to a specific remote. The combination of those two improvements should make a vast improvement in experience for our users:
gh pr createby default will always push to a fork if one exists - this will be a better default since the considerable majority of users have asked for this. A better default (ideally) means that fewer people will need an option to change it.git push <remote> HEAD && gh pr createwill allow one to choose where the branch is pushed, alleviating the need for--remoteflag.At this moment we're trying to avoid adding too many configuration flags because that could over time prove to be difficult to maintain.
casperdcl commentedon Mar 17, 2020
on the other hand, quietly setting defaults without exposing config options is also dangerous. I don't personally mind, but others might. Happy if (2) works:
will auto-create a PR
fork:branch->upstream:masterfruch commentedon Sep 5, 2024
I'm run into this issue today, and surprisingly someone already suggested here what I need in 2020... thanks @fruch you know exactly what I need...
just to add to who here, this option does exist now
gh create ... --head origin:branch_namebuild(pyproject): update development status classifier (cli#480)