Change default base repository for pull requests on forks #11729
Replies: 161 comments 124 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.
-
I need this, I accidently spammed upstream 3 times in the last two days... |
Beta Was this translation helpful? Give feedback.
-
I need this. Messed up twice over the last week. |
Beta Was this translation helpful? Give feedback.
-
I just did this with another repo. Come on GitHub! |
Beta Was this translation helpful? Give feedback.
-
+1 to change this |
Beta Was this translation helpful? Give feedback.
-
And the irony is – GitHub wants to maintain the link to original code, but all this does is push people to bare clone the repo and break the link to the original fork! The very feature they are deaf to implement is the very feature that is fucking over Open Source creators! 🤯 All they need to do is allow fork maintainers to merge by default to their own fork, then at some future juncture, original creators can catch up, and in theory everyone could be happy 😊 |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Definitely a maintainer friendly feature! +1 |
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.
-
I need this too. |
Beta Was this translation helpful? Give feedback.
-
For the people who have accidentally opened a PR against an upstream repo, I'm curious what exact workflow you're using to open a PR. GitHub web interface? Currently working on a browser extension that would prevent accidental PRs, but it will only help if you're using the web interface to open PRs. Are there other workflows/interfaces that people are using to open PRs where they run into this issue? |
Beta Was this translation helpful? Give feedback.
-
I believe the lack of this feature is breaking GitHub Workflows. Because workflows can only be run from the default branch, they will never run in a forked repo. If this isn't going to be directly fixed, it would at least be nice to see a warning when one attempts to run a Workflow that cannot run for this reason. |
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.
-
I asked github's copilot about this, and
I tried, and it doesn't seem to work. |
Beta Was this translation helpful? Give feedback.
-
Hey @github is there any update on this? Really could do with this! |
Beta Was this translation helpful? Give feedback.
-
Adding my +1 to this. This feature would be extremely valuable. |
Beta Was this translation helpful? Give feedback.
-
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