如何在GitHub上分叉非GitHub仓库?

时间:2012-02-13 22:14:27

标签: git github branch

这是最好的做法吗?我想要

  • 创建一个仓库,将原始仓库添加为上游远程

  • 创建一个“镜像”仓库,然后分叉

  • 创建“镜像”仓库,然后创建“主题分支”

  • 其他

相关: help.github.com/send-pull-requests

1 个答案:

答案 0 :(得分:18)

这就是我最终做的事情:

  1. 在GitHub上创建新的回购

  2. 克隆新的回购

    git clone git@github.com:svnpenn/spoon-knife.git
    
  3. 从原始仓库添加源代码

    cd Spoon-Knife
    git remote add upstream git://spoon.com/knife.git
    git fetch upstream
    git merge upstream/master
    
  4. 将原始源代码推送到新的仓库

    git push origin master
    
  5. 此时您可以开始提交您自己的源代码!

  6. 来源:help.github.com/fork-a-repo