Reputation: 91
Been working with git for some time now. There are plenty tutorials and explanations on git pull request. What is it's motivation and etc.
I encounter two scenarios:
1. Forking git repo
I view some public git repository and decide that I want to contribute so I:
Create a duplicate repository by Forking it. For example branch master.
Make my changes and commit them.
2. Branch git repo
Lets say me and my of my team members are working on this git repo. I working on a certain feature called 'my-feature'. So I do the following:
Like I said, I understand the way pull requests work in the above examples.
My issue: Mirroring
Yet, I'm working on an assignment in which I was explicitly requested not the fork the repo but to mirror it.
I followed the procedure listed on the github help supplied by the following link:
https://help.github.com/articles/duplicating-a-repository/
Basically what I did was to:
create a bare clone of the public repository:
git clone --bare https://github.com/exampleuser/old-repository.git
mirror push to new repository ( which is on my github account)
cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git
I made my changes and committed them to my own mirrored copy. Now how do I create a pull request to the owner of the repository without forking it?
Upvotes: 2
Views: 4115
Reputation: 387507
As you already pointed out, there are only two ways that allow you to create pull requests: Either from a fork or when you have contributor access to the original repository. If you have neither, then you’re out of luck here.
The only thing you could do is create an issue and ask for a pull (which is kind of a very manual pull request).
There is a related issue about GitHub’s command line interface hub, asking for a way to submit a pull request without a fork. The comments there discuss how this would work, and various members point out that it won’t be possible without a fork:
j1z0: If you don't push rights you have to use a fork because the permissions in GitHub are per repo not per branch.
mislav: It's only possible to open a pull request without a fork if you have push access to the original repository. Then you can simply push to a new branch in that repo and use
hub pull-request
.In other cases, you must create a fork with
hub fork
and push to the new remotegit push -u skywinder HEAD
and open a pull requesthub pull-request
.
Upvotes: 1