git - 如何在 GitHub 上 fork 一个非 GitHub 仓库?

标签 git github branch

有这方面的最佳实践吗?我在想要么

  • 创建一个 repo,将原始 repo 添加为上游 remote

  • 创建一个“镜像”repo,然后 fork 那个

  • 创建一个“镜像”repo,然后创建一个“主题分支”

  • 其他

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

最佳答案

这就是我最终做的:

  1. 在 GitHub 上创建新的 repo

  2. 克隆新的 repo

    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. 将原始源码推送到新的repo

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

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

关于git - 如何在 GitHub 上 fork 一个非 GitHub 仓库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9268849/

相关文章:

linux - 'git svn' 不再启动 git-svn

git - 将 GitHub 私有(private)仓库克隆到远程服务器上

linux - 当我尝试推送到 Linux AWS 服务器上的裸存储库时,出现 'insufficient permission...' 错误

git - .gitconfig 的 [github] 部分如何工作?

git - 断开本地分支与远程分支的连接

function - gnuplot 忽略多分支拟合中的第二个分支

Git diff -name-only 与完整文件路径

Github - 在提交消息中创建指向我的 JIRA 问题的链接

android - Git 存储库突然不再更新,即使它在 Android Studio 端提交/推送正常

Git merge 错误