Pull Request uses wrong default branch

In the settings for my repository, I defined master as the default branch.

When I open a new pull request, the master branch of the repository I forked mine from is selected.

I updated the settings multiple times already, but the correct default branch is never pre-selected.
How can I avoid these cross-repository pull requests by default?

Hi @ThomasKoppensteiner - welcome to the community! :wave:t3:

Would you mind sharing a screenshot or a link to help us understand what you’re seeing vs. your expectations?

It sounds like you expect the pull request to be raised against your own fork (<your-repo>:master branch), instead of the upstream repo (<upstream-repo>:master branch) … is my understanding correct or have I totally missed the point?

I haven’t used forks at all, so I’m hoping to pick up some tips on this when someone enlightens us! :crossed_fingers:t3:

Hello,
I’m not allowed to embed images in my posts.

The current situation:
Base repository: TheWudu/sidekiq-cleaner branch master <== Head repository: ThomasKoppensteiner/sidekiq-undertaker branch feature-branch

Goal:
Base repository: ThomasKoppensteiner/sidekiq-undertaker branch master <== Head repository: ThomasKoppensteiner/sidekiq-undertaker branch feature-branch
(Short: master <== feature-branch)

My repository

Thanks for the update @ThomasKoppensteiner

I think this is a temporary restriction that’s removed for new users to the community after being active for a while, mainly to avoid spam accounts posting.

Back to your original issue … I may have found a possible solution, but I’m totally guessing, so please bear with me! I recently forked a repo in PR#49565, following the instructions in the First Contributions README.md file.

  • Before creating the 1st PR, I noticed there were four options for selecting the repos & branches (as shown in the table below). Sadly, I merged the 1st PR before checking the different options in the dropdown lists.

    • In a follow-up test, I edited a file in my own fork, and created a PR from that fork. The PR only showed the last two options, i.e. my-fork & my-feature-branch (see open PR).
  • Below are the default dropdown options plus an example for configuring your PR, based on the First Contributions README.md:

    Options Default repo Default branch Your example
    base repository upstream ThomasKoppensteiner/sidekiq-undertaker
    base branch master master
    head repository my-fork ThomasKoppensteiner/sidekiq-undertaker
    compare branch my-branch feature-branch

Please clarify the following for your PR:

  1. Are you able to modify the dropdown items to match your requirements?

  2. Did you create the PR from your (forked) repo or the upstream repo?

  3. Can you edit two or four dropdown options?

    • Two options appear if your PR is raised against your own fork.
    • Four options appear if your PR is raised against the upstream project.

Please let me know if this helps. I’m learning as I go along, so it’ll help my understanding too! :slight_smile:

When I click on “New pull request” in my forked repo, Github opens the upstream repo and selects its “master” as the target branch of the pull request. I then see four dropdowns as described by anxumalo.

My goal is to open new pull requests against the “master” branch in my repo by default (2 dropdowns).

To your questions:

Are you able to modify the dropdown items to match your requirements?

Yes, but I want to avoid this.

Did you create the PR from your (forked) repo or the upstream repo?

From my forked repo, but Github automatically opens the upstream repo.

Can you edit two or four dropdown options?

Four, because the pull request is opened from the “wrong” / upstream repo.

Example PR, where I changed the base repository back to my repo.

Is it possible to “un-track” the upstream repo? It is no longer actively maintained.

Oh no … I expected it to open the PR against your repo, as shown in my testing. :frowning:

Thanks for sharing the example PR. I’m afraid I’m out of my depth, so I can’t help any further without seeing what you’re doing! :slight_smile: