将github上的git repo复制/分叉到同一个组织中 [英] Copy/fork a git repo on github into same organization

查看:263
本文介绍了将github上的git repo复制/分叉到同一个组织中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在github上有一个仓库,其中包含一个部署到两个不同域的Web应用程序。该应用程序在这里和那里的逻辑分支略有不同,具体取决于部署到哪个域。

I have a repo on github that contains a web application that's deployed to two different domains. The application has slight logic forks here and there to behave differently depending on which domain it's deployed to.

现在我想将它分成两个单独的位置repos,每个域名一个。

It's come to the point to where I want to split it into two separate repos, one for each domain.

Github不会让我把它分成同一个组织。搜索git duplicate repo表明我应该克隆和镜像推送它,但这似乎是为了保持两个同步的回购,我不想这样做。

Github won't let me fork it into the same organization. Searching for "git duplicate repo" suggests I should bare clone and mirror push it, but that seems to be for keeping both repos in sync, which I don't want to do.

最好的办法是什么?如果可能的话,我希望在新副本中保留旧的提交历史记录。

What's the best way to go about this? I'd like to preserve the old commit history in the new copy if possible.

推荐答案

只需创建一个新的存储库,它从你的工作副本:

Just create a new repository and push to it from your working copy:

git clone git@github.com:me/myrepo-original
cd myrepo-original
git remote set-url origin git@github.com:me/myrepo-new
git push origin master

现在您有一个新的存储库 myrepo-new ,它与 myrepo-original

Now you have a new repository, myrepo-new, which is identical to myrepo-original.

这篇关于将github上的git repo复制/分叉到同一个组织中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆