GitHub pull request from private to public repo possible?

后端 未结 2 1513
一向
一向 2021-01-02 02:24

I forked a public repo and made the new repo private.

I added a new remote branch on my private repo with some fixes committed.

Now, I want to create a pull

相关标签:
2条回答
  • 2021-01-02 03:00

    One solution would be to fork the original public repo into your own public repo on GitHub.
    Then fork that public repo (that you own) into a private one.

    You then clone both on your local workstation, and:

    • do public and private modifications on your private local repo
    • push whatever public modification to your local public repo (that you can push to your GitHub public repo)
    • make your pull request from your forked public repo on GitHub.
    0 讨论(0)
  • 2021-01-02 03:15

    I doubt it's intended by Github but you can actually make a pull request from a private to a public repo with a bit of simple DOM manipulation:

    1. Make your changes on your private repo, probably on a fresh branch.
    2. Start a pull request. Hit the change commits button.
    3. Open up an editor that allows you to modify the DOM. Things like Firebug or the Safari web inspector or Chrome developer tools seem to work fine.
    4. Edit the base branch repository. You'll want to change the selected option tag's value.
    5. Next, click on the branch name (and change it if you want). You need to do this to trigger an ajax update.
    6. Update the commit range and you should be good to go.

    Some caveats:

    • Clicking the commit links or view file will 404 for the public or users who aren't listed as collaborators. Everything seems fine once it's merged in, but it may be a bit weird for the maintainer of the public repo.
    • The pull request needs to be accepted only from the UI. I don't think it'll let anyone merge or cherry-pick the commits in manually. Conflicts will likely need to be resolved by the private repo owner.
    0 讨论(0)
提交回复
热议问题