zoukankan      html  css  js  c++  java
  • GitHub 更新fork的代码

    转载地址:http://blog.csdn.net/do_it__/article/details/7836513

    一、前提

    本文的前提是你已经在github上fork了别人的分支,并且弄好了跟github的ssh连接。
    相关配置详情参考:https://help.github.com

    二、详细操作

    1. 检出自己在github上fork别人的分支到rrest目录下,其中rrest目录之前是不存在的。
      git clone git@github.com:yss/rrestjs.git rrest
    2. 然后增加远程分支(也就是你fork那个人的分支)名为bob(这个名字任意)到你本地。
      git remote add bob https://github.com/DoubleSpout/rrestjs.git
      如果你运行命令:git remote -v你会发现多出来了一个Bob的远程分支。如下:
      bob https://github.com/DoubleSpout/rrestjs.git (fetch)
      bob https://github.com/DoubleSpout/rrestjs.git (push)
      origin git@github.com:yss/rrestjs.git (fetch)
      origin git@github.com:yss/rrestjs.git (push)
      
    3. 然后,把对方的代码拉到你本地。
      git fetch bob
    4. 最后,合并对方的代码。
      git merge bob/master
    5. 最最后,把最新的代码推送到你的github上。
      git push origin master

    这样就完成了自己的代码更新。

  • 相关阅读:
    软工实践个人总结
    第02组 Beta版本演示
    第02组 Beta冲刺(5/5)
    第02组 Beta冲刺(4/5)
    第02组 Beta冲刺(3/5)
    第02组 Beta冲刺(2/5)
    第02组 Beta冲刺(1/5)
    第02组 Alpha事后诸葛亮
    第02组 Alpha冲刺(6/6)
    第02组 Alpha冲刺(5/6)
  • 原文地址:https://www.cnblogs.com/LittleRedPoint/p/4478933.html
Copyright © 2011-2022 走看看