You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何设置GitHub默认选择公司仓库作为Pull Request目标仓库?

How to Set Your Company's Fork as the Default PR Target on GitHub

Great question! I've run into this exact annoyance with forked repos too—here are a few solid workarounds since GitHub doesn't have a built-in setting for default PR target repos:

  • Use the branch page's "Compare & pull request" button directly
    Skip the generic PR flow entirely. Navigate to your company's fork on GitHub, find the feature branch you've pushed changes to, and click the prominent "Compare & pull request" button at the top of the branch page. This will automatically pre-select your company's repo as the target (with its default branch like main as the base) so you don't have to hunt through the repo list.

  • Leverage GitHub CLI (gh) for one-click PRs
    If you prefer command-line workflows, install the GitHub CLI tool. Once set up, you can create a PR targeted directly at your company's repo with a single command:

    gh pr create --repo <your-company-account/repo-name> --base main --head your-feature-branch
    

    The CLI will remember your repo preference for subsequent PRs from the same branch, so you won't have to specify the repo every time.

  • Create a custom browser bookmark for PRs
    Make a bookmark with this URL structure (replace placeholders with your actual repo details):

    https://github.com/<your-company-account>/<repo-name>/pull/new/<your-feature-branch>
    

    Every time you need to open a PR, click the bookmark—you'll land directly on the PR creation page with your company's repo already set as the target. Just fill in the title and description, and you're good to go.

These methods all cut out the tedious step of manually selecting your company's repo every time. I use the first method most often since it's the fastest without any extra tools!

内容的提问来源于stack exchange,提问作者atiq1589

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:08:49