GitHub pull request from private to public repo possible?

后端 未结 2 1529
一向
一向 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: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.

提交回复
热议问题