How does git update code in merge github forked repository?
[Refer to] http://www.haojii.com/2011/08/how-to-git-merge-from-forked-repository/]
The problem is that there is a ruby-gmail project in github. I need to get some Bug Fix code from another repository in the same project of fork.
Link1: https://github.com/dcparker/ruby-gmail (original author dcparker repository)
Link2: https://github.com/jihao/ruby-gmail (I'm from link1 fork repository)
Link3: https://github.com/geoffyoungs/ruby-gmail (geoffyoungs repository from link1 fork, and then he modified some bugs, but was not merge back to the original author of link1 repository)
After git clone repository to the local machine, I found that link3 has the code I want. I want to change the merge on link3 to my repository to avoid having to change the same bug.
How does git update merge github forked repository?
The specific method is the following three steps. I haven't used git to do this before. It's actually quite simple after knowing it.
1. >git remote add geoffyoungs http://github.com/geoffyoungs/ruby-gmail.git
2. >git fetch geoffyoungs
3. >git merge geoffyoungs/master
The local repository looks like this:
>git remote -v
geoffyoungs http://github.com/geoffyoungs/ruby-gmail.git (fetch)
geoffyoungs http://github.com/geoffyoungs/ruby-gmail.git (push)
origin http://jihao@github.com/jihao/ruby-gmail.git (fetch)
origin http://jihao@github.com/jihao/ruby-gmail.git (push)
>git branch -a
* master
remotes/geoffyoungs/gh-pages
remotes/geoffyoungs/master
remotes/origin/HEAD -> origin/master
remotes/origin/adimircolen-master
remotes/origin/gh-pages
remotes/origin/master