您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Allow GitHub forks to be configured to default to self for pull request base
当前为
This TamperMonkey script helps with the situation where you have a fork of a repository, and you don't want to break the upstream relationship, but you also don't want your Pull Requests to go to the upstream repository by default. As of writing this, GitHub has neglected this issue for at least 3 1/2 years (since February 2022), and the only workaround proposed thus far is to permanently sever the upstream relationship by using the "Leave fork network" option.
What this little script does is, you can configure one or more repositories so that they default to themselves when making pull requests. Then, the next time you click "Compare & pull request" or "Open pull request", when it detects that a new Pull Request page has loaded for creating a pull request against the upstream repository, it immediately redirects to the equivalent page for making a pull request against your fork. If you want to override it, you can click "Back" to return to the upstream repository version and it'll let you use it.
With this script installed, a new button is injected into the Pull Request view to allow you to configure which repositories should be given this treatment:
In this version, the resulting window is not very polished, but it does work. A future version might improve on things :-)
As shown here, simply specify your repositories in the format "USERNAME/REPONAME".
This script is hosted on Greasy Fork镜像.
To install it through Greasy Fork镜像, navigate to the script's page and then click on the green "Install this script" button.
You can install the script the old-fashioned way if you want. I've always done in this way:
It is also possible to temporarily disable it if you need.
Source code is in GitHub:
https://github.com/logiclrd/GitHubForkDefaults/
Feel free to fork it and propose PRs. :-)
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址