Change default base repository for pull requests on forks #11729
Replies: 183 comments 154 replies
-
More discussion at https://github.community/t/changing-the-default-pr-target-when-creating-a-pr-from-a-fork/2842/2 |
Beta Was this translation helpful? Give feedback.
-
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.
-
Has anyone got an update on how to change the base repo? |
Beta Was this translation helpful? Give feedback.
-
To change this behaviour you'd have to change the Compare page URL by external add-ons.
I'm talking a green pull request button. |
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.
-
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.
-
I can attest - this is very annoying. |
Beta Was this translation helpful? Give feedback.
-
same experience here. My solution was finally to create fork form the fork: |
Beta Was this translation helpful? Give feedback.
-
The output of |
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.
-
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.
-
Please provide this setting. |
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.
-
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 (22 and counting): |
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.
-
:+1 - and I don't want a browser extension for this, because I (and I'm not the only one) don't use chrome / firefox / edge. This is something that needs to be sorted by github not by extension authors. I mean, it lets you create issues against the forked repository and run workflows against the forked repository but you have to go through hoops to make PRs to fix the issues that have been raised... |
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.
-
@github I feel embarrased for your org reading through this thread. My specific use case is covered above multiple times by multiple devs for over 2 years now. There have been numerous occasions when I've accidentally opened a PR against the origin repo that's no longer maintained by me. Funnily enough, I have the most activity on the origin repo now because of the number of times I've had to close accidental PRs. The only explanation I would've accepted is that this is not available in the free tier. Sadly, I pay for GitHub enterprise and still have to deal with this nonsense. Get it together and fix it. |
Beta Was this translation helpful? Give feedback.
-
My guess is it's a technological debt for @github, and they don't really know how to fix it. |
Beta Was this translation helpful? Give feedback.
-
Apparently we need to wait until Github's copilot achieves consciousness, so it (they?) can solve this issue, as it seems too much for a specimen of the human species. Please save us Github copilot! |
Beta Was this translation helpful? Give feedback.
-
+1 why is. this not a setting |
Beta Was this translation helpful? Give feedback.
-
I would also like this! |
Beta Was this translation helpful? Give feedback.
-
The lack of that simple BASIC and NECESSARY setting prevents teams from working with forks while actually needed! GitHub, please do react! Implementing it is a no-brainer! |
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.
-
I sent a bug report to GitHub mentioning this thread.
|
Beta Was this translation helpful? Give feedback.
-
Interesting note, looks like GitLab added the ability to "change the default merge target" in 2021. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/58093. |
Beta Was this translation helpful? Give feedback.
-
How do we get github-actions bot to "submit feedback" like it did on this other discussion thread? https://github.com/orgs/community/discussions/5022#discussioncomment-12576365 |
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 would love to get a solid answer from GitHub as to why they have, to date, taken no action on this issue. |
Beta Was this translation helpful? Give feedback.
-
Since GitHub still hasn’t addressed this issue, I decided to make the Safe Pull Request extension free for personal repos. As a reminder, the extension will default the base repo to your fork (not the upstream) when opening a PR from the GitHub web UI — so no more accidental PRs against the wrong repo. Here's the link: |
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