I'd like to make an edit to improve this answer.
The edited answer would look like this:
You probably have a "remote" for each repository. You need to pull from the one remote and push to the other.
If you originally cloned from your fork, that remote will be called "origin". If you haven't added it already, you'll need to add the first person's repository as another remote:
git remote add firstperson git://github.com/firstperson/repo.git
After that's all set up, you should indeed be able to
git pull firstperson master git push origin
Remember,
git pull
is nothing more than a macro that doesgit fetch
andgit merge
, in that order. You just need to fetch the list of commits from the first person's repository and then merge their branch into your tree. Merging should do the right thing with your commits on both branches.GitHub, in all its perpetual awesomeness, gives you a shortcut, of course. There's a "fast-forward" button on your fork of the repository that you can use to catch your fork up if you're entirely merged in to the other side.
The edit reason would be:
github's URLs follow a structure of https://github.com/username/repository.git . The original "firstguy" was more easily identifiable as an username. Changing "firstguy" -> "first" made it harder to understand what user the URL is about.
The other change, changing the repo name from "firstguy" to "firstrepo" also made the answer harder to understand. Which is the first repo? The one which is first chronologically or the one cloned from first?. "firstguy" or "firstperson" is a much easier to understand name for a repo. Much as "Jhon's dog" is easier to understand than "First dog".
But since there was some controversy about this and the edit was approved by a staff member I feel uncomfortable with using the 2k privilege "edit questions and answers".
Should I go ahead and perform the edit?
shortname
, so let's use it. Since there already was a rollback to the original revision, but there doesn't seem to be any vocal disagreement, I made the edit accommodating both what I proposed and Makyen's comment. As a Solomon solution, I also changed "guy" and "persona" to "other" (the answer already used "other" to designate the "guy's" repository)