git如何merge github forked repository里的代码更新 haoji

Posted on

git如何merge github forked repository里的代码更新 haojii

haojii

一个专注于技术的IT男

Search

Skip to primary content

Skip to secondary content

Post navigation

← Previous Next →

git如何merge github forked repository里的代码更新?

Posted on 2011/08/20 by Jacky

问题是这样的,github里有个项目ruby-gmail,我需要从fork自同一个项目的另一个repository拿一些Bug Fix的代码 link1:https://github.com/dcparker/ruby-gmail (原作者dcparker的repository) link2:https://github.com/jihao/ruby-gmail (我从link1 fork的repository) link3:https://github.com/geoffyoungs/ruby-gmail (geoffyoungs 从link1 fork的repository,然后他有些Bug修改,但是没被merge回原作者的link1的repository)

也就我git clone repository到本地后,发现link3有我想要的代码,我要把link3上的改动merge到我的repository上,避免我花精力改相同的bug

git如何merge github forked repository里的更新? 具体做法是下面三步,以前没用git这么搞过,知道之后其实蛮简单 **

  1. git remote add geoffyoungs http://github.com/geoffyoungs/ruby-gmail.git 2. >git fetch geoffyoungs 3. >git merge geoffyoungs/master **

本地的repository看上去是这样的:

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

想要保存喜欢过的文章吗?立即关联或创建无觅帐号

不再提示!

0 正在加载推荐文章

其他文章:

无觅 This entry was posted in 小问题 and tagged git, github, gmail by Jacky. Bookmark the permalink.

2 thoughts on “git如何merge github forked repository里的代码更新?”

  1. Christopher Meng on 2012/07/13 at 13:03 said:

什么时候直接网页操作就好了。。。

  1. lsff on 2013/01/07 at 10:38 said:

哇,这技术博客太漂亮了,博主自己弄得么?

发表评论 取消回复

电子邮件地址不会被公开。 必填项已用 /* 标注

姓名 /*

电子邮件 /*

站点

评论

您可以使用这些 HTML 标签和属性:

Proudly powered by WordPress

无觅相关文章插件,快速提升流量

希望本站内容对您有点用处,有什么疑问或建议请在后面留言评论
转载请注明作者(RobinChia)和出处 It so life ,请勿用于任何商业用途