日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2023/12/15 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 git如何merge github forked repository里的代码更新? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

轉自?haojii?發表于2011/08/20

問題是這樣的,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

3 其他文章:
  • git stash
  • 基于arduino和ruby的gmail郵件提醒
  • 空虛,貼一段代碼
  • Ruby入門-方法-代碼塊-閉包-Proc-lmabda
  • Christopher Meng在 2012/07/1313:03 說道:

    什么時候直接網頁操作就好了。。。

  • 轉載于:https://my.oschina.net/weichou/blog/414700

    總結

    以上是生活随笔為你收集整理的git如何merge github forked repository里的代码更新?的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。