`
loveq369
  • 浏览: 24715 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

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

    博客分类:
  • git
git 
阅读更多

转自:http://www.haojii.com/2011/08/how-to-git-merge-from-forked-repository/

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

问题是这样的,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

分享到:
评论

相关推荐

    GWL-elecTRON:guild elecTRON的GitHub研讨会的存储库

    重要的Git命令可贡献给任何存储库分叉此存储库使用以下命令git clone [url of forked repository]到您的系统上: git clone [url of forked repository] 使用命令创建一个新分支git branch [branch-name] 使用命令...

    resume-nextjs:任何人都可以使用Next.js轻松制作的静态HTML简历

    # fork to your github account & git cloning your forked repository npm install 运行开发模式 npm run dev 结构 资产/ 图像,图标 成分/ React组件 页数/ 只有一页用于呈现index.html 。 有效载荷/ 仅通过更改...

    vscode-github-actions:VSCode扩展提供了Github Actions YAML支持

    GitHub Actions YAML扩展通过提供Github Actions YAML支持。特征1. YAML验证将架构验证应用于GitHub操作检测错误,例如: 无效的属性值类型超出枚举范围缺少必需的属性意外... # clone your forked repository$ git cl

    leetcode2-Coding:稍微练习编码

    the-name-of-your-forked-repository 3. add upstream for your local repository #git remote add upstream https://github.com/PerthCharles/Coding.git 4. get the newest version of this repository #git ...

    VBSHWWBabyLooper

    recursive git@github.com:<yourgitusername>/VBSHWWBabyLooper.gitcd VBSHWWBabyLoopergit remote add upstream git@github.com:cmstas/VBSHWWBabyLooper.gitgit pull upstream main # to pull changes upstream ...

    creative-code-algorithms-and-techniques

    创意代码算法和技术网站: :fireworks: :sparkler:贡献在GitHub上此项目() 用git clone your-forked-github-repository fork git clone your-forked-github-repository 安装 在项目目录中运行: jekyll serve 在...

    git-idle:通过终端直接从github存储库中列出,克隆和安装依赖项

    正在安装$ npm install -g git-idle如何使用git-idle --help Usage: main < user> [options] CLI to download a repository from a github user and install dependencies Options: -V, --version Output the ...

    scalikejdbc.github.io:ScalikeJDBC官方网站

    在网站目录下更改如何调试: git clone [your forked repository].cd scalikejdbc.github.iogem install bundlerbundle install --path vendor/bundle# bundle exec middleman buildbundle exec middleman server从...

    skinny-framework.github.io:瘦框架官方网站

    在网站目录下更改如何调试: git clone [your forked repository].cd skinny-framework.github.iogem install bundlerbundle installbundle exec middleman server从浏览器访问http://localhost:4567/ 。提出请求...

    R_assignment:啊啊啊啊

    Clone your forked GitHub repository to your computer so that you can edit the files locally on your own machine. Edit the R file contained in the git repository and place your solution in that file ...

Global site tag (gtag.js) - Google Analytics