A colleague of mine forked my GitHub repository, and he adds his modifications. However, when he makes a pull request, it is not reported to my repository: the list of open pull requests is still empty.
In order to apply his modifications on my work, I must go to his repository and apply the pull request myself
Unless I misunderstood the pull request concept, do you a have a solution on this? Should I recreate my repository?
I must inform you that repository was a private one before I made it public.
Your colleague should create a pull request that targets your repository. The easiest way to do this is to navigate to your repository and create the pull request from there:
Confirm that the base fork is the repository you'd like to merge changes into. Use the base branch drop-down menu to select the branch of the upstream repository you'd like to merge changes into.
If the pull request is created properly, targeting your repository, you should see it in your list of pull requests.
Related
I have a project on GitHub, and I forked it to a second repository.
There is still work done on the repo that I forked from, but the changes I make to the first repo should also be applied to the forked one.
How can I push a pull request to both of them at the same time? Or is that impossible to do in a simple way?
If it is, is there a simple alternative solution?
No, GitHub pull requests only target a single repository.
Pull requests are only relevant when you are communicating with other people. Since both repositories are yours, you can just execute a git pull or git merge command on your local machine to merge whatever branches you want to merge. Then use git push to push the changes up to GitHub if you want.
Also, I recommend that you simplify this setup and just use a single GitHub repository with multiple branches.
forking iss not allowed (for this repository on github). So what I did was I cloned the repository to my local folder, Then made my changes and did a commit. then pushed it into my own repository on github.
Problem, my repository is not denoted as a fork in github. So there is no way to create a pull request to the original repository.
How do I set my upstream in github?
I tried to set upstream using git remote add, and create a pull request using git request-pull. But while the commands were successful, nothing showed up in github... my repository still does not show as a fork
when I try to create a pull request from the website, pushing "new pull request" button, I only see the same branch, I do not see my own fork even when choosing "across forks"
You cannot create a pull request from a repository that is not a fork. On GitHub, all the forks, plus the main repository, form a repository network, which shares objects. This is a requirement in order to create a pull request.
If you have push access to the original repository, then you can push your branch there and create a pull request from there. If you don't and the repository owner has prohibited forking, then you'll need to talk with them about how to get your change proposed.
I wanted to contribute to the FCC guides and I actually did.
This is my fork to the repository
Link: https://github.com/BitYog/guides
However, when I open the main guides repository, I don't see my changes being shown anywhere. What do I do so that my changes are merged and committed into the main repo?
You don't see your commits in the original repository, because you didn't create a pull request against that repository, but against your fork. In other words, you opened a pull request to merge BitYog/guides#BitYog-patch-1 into BitYog/guides#master. With that, you updated your own master branch, but not that of freeCodeCamp/guides.
Your changes will only show up when a pull request into freeCodeCamp/guides#master is merged. For that to happen, you need to open a new pull request in the freeCodeCamp repository and request to merge either your master or BitYog-patch-1 branch into master.
Say I have a repo and someone forks it. Then they do work and submit a pull request. But the code contains a large number of lines and/or it creates a GUI. I'd like to fetch it so I can actually see it run from Eclipse before merging it into my master. The options I've come up with are:
Create a second repo in EGit and clone directly from their fork.
Create a new branch just for them. Then leave a comment for the request asking them to re-submit the pull request using the new branch and that I'll be closing the current request (without merging)
Always keep around a branch for them to use in their pull requests.
Besides setting up an organization on Github what else could I do?
Then leave a comment for the request asking them to re-submit the pull request using the new branch and that I'll be closing the current request
They don't have to re-submit, it you test and merge first locally, as described in the "Merging a pull request" GitHub page.
git checkout master
git pull https://github.com/otheruser/repo.git branchname
If the local merge works, then you can go ahead and merge the pull request through the GitHub web interface.
GitHub has documented how to checkout a pull request.
As I have illustrated before in "What support for git namespaces exists in git hosting services", you can use refs/pull/<PRNumber>/head as remote pull reference, in command line or in Egit when, for instance, creating a new branch.
If the PR number is 123, you can simply use the EGit Pull action, and use pulls/123/head as reference.
I've made multiple commits to my local repository and now I intend to do pull request to submit these changes over to the source/master.
When I do a pull request, it automatically includes all of my commits. I couldn't locate a way to submit each commit in its own pull request. Could someone please give some pointer on how to do this on GitHub.
Update
To clarify on this question, I forked a new local repo from upstream/master. Then, in my noobie-ness, I made new files in my local master itself without branching repo out first. So, effectively, my question is with these changes committed to local master repo, is there a way to raise pull requests for each new file one by one, and not for all of them in one go.
Many Thanks.
I'm not sure if there is a better way in GitHub, but in general, you can create a new branch for each pull request, cherry-picking the commits you want for each request.
The new branches should preferably be based on upstream master to make the merge painless.
Using command line git, using origin as your own github remote repo, upstream is the upstream remote:
git checkout -b {my_pull_request_feature_branch} upstream/master
git cherry-pick {sha1_of_first_commit_for_feature_X} [sha1_of_another_commit_for_feature_X] ...
git push origin {my_pull_request_feature_branch}
Repeat for each pull request.
When you do a pull request on GitHub you can then choose which branch you want to send in your request.
A commit does not stand on its own, it always links to the full previous history. So if you ask to pull commit B which depends on your commit A, then you are also asking to pull A, because your work in B depends on it.
If you want to submit multiple independent pull requests, you should make sure that those commits are completely independent of each other. So they should be on their own branches. This also makes it easier for the project maintainers to integrate your pull request, as they can just merge the branch without having to cherry-pick stuff.