16

For a GitHub pull request, you specify a base repo (where you want the changes to go) and a head repo (where they're coming from).

However, I would like to use a base repo that is not on the dropdown list. Is it possible to add a base repo to the list? There is a relationship between the two (they share the initial commits)

In the actual repo I want this for, the fork does not have the standard "forked from" that GitHub forks normally have below the name in the upper left. However, it is a fork; it just wasn't forked through the GitHub system. If you know how to add this metadata, I suspect that will also allow pull requests. (This question asks how to change the "forked from". but that part is not answered).

Community
  • 1
  • 1
Matthew Flaschen
  • 278,309
  • 50
  • 514
  • 539

2 Answers2

7

Is it possible to add a base repo to the list?

No, not by yourself.

Github only lets you do pull requests on forks it knows about, and offers no way to register two repos as forks of one another later on.

You have two options you could try:

  1. Contact Github support at support@github.com and describe your situation (briefly), including your username and the two repos involved. If you ask them for it, they might be able to add the "fork" status to your repo and thereby allow you to generate a PR
  2. Bypass Github for the addition of your changes: Git is not dependent on such things as pull requests, you can just contact the other project and ask them to merge in your changes. This can be done in several way, you could, for example, provide a patch of your changes, or they could add your Github repo and merge or rebase your changes.
Nevik Rehnel
  • 49,633
  • 6
  • 60
  • 50
-3

Try navigating to the following url:

https://github.com/[source]/[repo]/pull/new/[target:branch]...[source:branch]

Source

Ben
  • 15
  • 2
  • Sure, the following works for me (but probably not for anyone else!) https://github.com/Meatballs1/metasploit-framework/pull/new/rapid7:master...Meatballs1:master – Ben Apr 03 '13 at 21:15
  • I asked how to do it when the "forked from" is not there. In your example, it is ("forked from rapid7/metasploit-framework") – Matthew Flaschen May 28 '13 at 22:59
  • @MatthewFlaschen Did you happen to try it and find that it did not work? I wrote the article referenced in this answer and if you can confirm it did not work I can update the post to say as much. :) However, it is possible it may work. If you simply didn't try, please try to just to be sure and let me know. Thanks! – Beau Simensen Aug 20 '13 at 12:47
  • @BeauSimensen, I retested just now with https://github.com/wikimedia/mediawiki-extensions-GuidedTour-guiders/pull/new/jeff-optimizely:dev...wikimedia:upgrade_jquery. The idea (just a test, not a pull request I'm currently trying to do) is to submit https://github.com/wikimedia/mediawiki-extensions-GuidedTour-guiders/tree/upgrade_jquery as a pull request to https://github.com/jeff-optimizely/Guiders-JS/tree/dev. But GitHub doesn't get it, which is understandable if you think about it. The URL doesn't even include the base repo, just the base username. Without forked from", GitHub can't grok it. – Matthew Flaschen Aug 20 '13 at 23:57