Change default base repository for pull requests on forks #11729
Replies: 192 comments 176 replies
-
|
GitHub has a default branch setting. The page says:
Unless I am missing something, that setting is not respected for PRs on a fork, given that the default branch of the upstream repo seems to be taken as the base branch for the PR. How about adding a
When creating a PR, these settings could be used to give the current behavior. Then users could change the settings to fit their needs. I'd be happy to learn about any implications I might be missing π |
Beta Was this translation helpful? Give feedback.
-
|
The current developer experience is really hard to work with -- I've incorrectly opened (and then closed) PRs to upstream several times at this point and I'm going to have to just remove my upstream association which is a real shame. Would love a solution to this for future projects! |
Beta Was this translation helpful? Give feedback.
-
|
Why is this not a setting? One of the main use cases for Forking a repository is to take over a project that is out of maintenance - where the previous owner is ignoring all PRs. Please @github-staff consider just making it a setting so we don't have to click 3 times on every PR to avoid accidentally PR'ing the fork. Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
π Hi, hi! Wanted to let the group know that we are investigating this (thank you for this feedback, it's extremely helpful for planning!) and I'll update here when I have some more news β¨ |
Beta Was this translation helpful? Give feedback.
-
|
I can attest - this is very annoying. |
Beta Was this translation helpful? Give feedback.
-
|
Please provide this setting. |
Beta Was this translation helpful? Give feedback.
-
|
I maintain a website template that people fork to use. The fact that the github UI for pull requests defaults to the upstream repo instead of the base repo has caused so many people (including me!) to open accidental PRs (against the template itself instead of their own main branch) that I had to create a label specifically for it (39 and counting): |
Beta Was this translation helpful? Give feedback.
-
|
Same problem here! Just today I closed a PR just clicks before merging it to master on the wrong repository. |
Beta Was this translation helpful? Give feedback.
-
|
This behavior is so frustrating. As a workaround, to detach a repository you can request a ticket here: https://support.github.com/contact?tags=rr-forks&subject=Detach%20Fork&flow=detach_fork |
Beta Was this translation helpful? Give feedback.
-
|
This starts to suck. The thread is over a year old and as far as I could see has gotten no reaction from GitHub. There are two aspects to this that make this very annoying: first, it's bothering lots of people and second, as I pointed out in my earlier post, this should be relatively easy to fix. One option to potentially get some traction with this, is for someone with an appropriate account type (Pro, Enterprise etc.) to open a support ticket and point this out. I've had success doing that with Atlassian but I only have a free GitHub account myself. |
Beta Was this translation helpful? Give feedback.
-
|
Same situation here, we want to work mainly in our fork and contribute some PRs upstream, so we don't want to detach. We had some accidental PRs already, and it's embarrassing. Please let us configure the default |
Beta Was this translation helpful? Give feedback.
-
|
Yet another frustrated user who's trying to keep the fork link without having to manually check where I'm pushing my PR to. Please, fix this. |
Beta Was this translation helpful? Give feedback.
-
|
The lack of any sort of a response from @github here is baffling. This is clearly a common pain point and, seriously, how long could this possibly take for them to implement? One of the orgs I work with has either a higher tier paid account and I'll see if they're willing to open a ticket about this problem. My use case, for whatever it's worth: we forked a repo which was making fundamental but experimental changes to the origin repo's application structure and contents. It may be upstreamed one day or both repositories may live on indefinitely. Until we have a better sense of which way things will play out, why should we have to constantly dance around the issue of selecting the target repository when opening a pull request? In our case, I'm not aware of anyone accidentally opening a PR to the wrong repo but the UX of switching the repository in the web UI, waiting for the page to refresh, etc. is worse than it has any reason to be. |
Beta Was this translation helpful? Give feedback.
-
|
Former GitHub engineer and open source maintainer of a long-running fork of mastodon here. I mostly make pull requests against my own fork and occasionally send patches upstream. I echo that the web interface really needs a default base repo setting for pull requests; I've made several embarrassing accidental PRs against the upstream repo, including one just yesterday. |
Beta Was this translation helpful? Give feedback.
-
|
So this settings is actually missing? What a shame, really. Being able to select a default |
Beta Was this translation helpful? Give feedback.
-
|
As of today this seems to be working as expected again. No more mentions of too many changes. |
Beta Was this translation helpful? Give feedback.
-
|
As of today this seems to be working as expected again. No more mentions of too many changes. |
Beta Was this translation helpful? Give feedback.
-
|
Really annoying there is no response or better solution for this. We ended up following the instruction on https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/detaching-a-fork but it comes with some major downsides:
ugh π |
Beta Was this translation helpful? Give feedback.
-
|
It seems like it might be possible to modify this behavior using GitHub Desktop (but apparently not with the GitHub web interface?). I haven't tried a Pull Request after doing this, but hopefully it'll work... In the GitHub docs, under GitHub Desktop/Contributing and collaborating/Add & clone repos/Clone & fork from Desktop/Managing fork behavior:
Note that the screenshots (and precise instructions) may be different if you visit the above support page on Windows rather than Mac. |
Beta Was this translation helpful? Give feedback.
-
|
This seems like the sort of thing a TamperMonkey script could help with. But, if I make a TamperMonkey script, will GitHub take that as indication that the problem is solved and they don't have to do anything? Conversely, is there any evidence that GitHub will take any action even if there is no solution? π https://greasyfork.org/en/scripts/544320-github-fork-default With this TamperMonkey script, when you click "Open pull request", if it pops up a compare window between your fork and the fork's upstream, it will immediately redirect to a compare window to the same branch in the fork. If you click the Back button, it'll return to the window that merges to upstream and will stay there, so you can override the behaviour. The script adds a button "Configure Base Defaults" that allows you to add the repositories where you want this behaviour enabled, syntax |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Another +1 into the void |
Beta Was this translation helpful? Give feedback.
-
|
Yet another feature github team will punt on. FFS guys get a grip on your tech-debt. Edit: Opened an issue with refined-github: refined-github/refined-github#8391 this is a cosmetic issue and can be fixed client-side. |
Beta Was this translation helpful? Give feedback.
-
|
I think a lot of people don't aware this settings in VSCode (at least I didn't until weeks ago) If you use VSCode for Git PR operation, I think this configuration will help this situation |
Beta Was this translation helpful? Give feedback.
-
|
+1 |
Beta Was this translation helpful? Give feedback.
-
|
Bumping this branch for another reason. I have a fork of a project which contains hundreds of SVG files, and every time I go to create a pull request the number of SVG previews literally causes Safari to hang. |
Beta Was this translation helpful? Give feedback.
-
|
A solution is to use Github API instead of the web UI to create pull request: example This can be wrapped in a |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, the question of this issue has evolved from "set the default repo for a PR" to why GitHub seems to not pay attention. Previously, I had asked whether there is an enterprise customer reading this who could raise this with their GitHub contact. That should be one way to get some attention for this. |
Beta Was this translation helpful? Give feedback.
-
|
Fwiw, what I do is I have:
I do my work in I have a script which sets this up (it also changes the default branch of both of my forks and adds some groups and other stuff). |
Beta Was this translation helpful? Give feedback.
-
|
I asked github's copilot about this, and I tried, and it doesn't seem to work. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've forked a repository which has been archived by the owner, so there won't be any prs accepted to the original repository.
Therefore I'd like to change the base repository for all PRs made from to my repository but this seems not possible.
Is there a recommended way to deal with this situation other than (re)creating the repository without forking?
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions