是否可以将公共GitHub存储库派生到企业存储库中? [英] Is it possible to fork a public GitHub repo into an enterprise repository?

查看:68
本文介绍了是否可以将公共GitHub存储库派生到企业存储库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处有一个公共框架.我希望能够将其分叉到私有企业GitHub存储库中.分叉将保留所有分支.

There exist a public repo for Quick framework here. I'd like to be able to fork this into a private enterprise GitHub repository. Forking would allow all the branches to remain.

另一种选择是克隆存储库,仅将单个分支推送到企业,但随后我就失去了没有来自源/原始站点的所有分支的机会.

the alternative would be to clone the repo and push up only a single branch to the enterprise but then I lose on not having all the branches from the source/original.

更新: 最后,我将所有分支机构推入了企业git. 如果您只是执行git push yourRemoteName myNewBranch,则它将在企业GitHub中创建该分支时将代码推入到企业git的该分支中.

update: I ended up pushing all my branches into the enterprise git. if you just do a git push yourRemoteName myNewBranch then it will push the code into that branch on the enterprise git while creating that branch in enterprise GitHub.

推荐答案

这是不可能的,因为您的Enterprise GitHub安装与公共安装是分开的,因此这两个系统无法跟踪彼此的分支关系.

It's not possible, because your Enterprise GitHub installation is separate from the public one, so there's no way for the two systems to track each other's branch relationships.

您能做的最好是完全按照您的描述:克隆存储库,然后将其推送到GHE安装中,是的,您将失去存储库之间的分支关系.

The best you can do is exactly as you describe: Clone the repo, then push it to your GHE installation, and yes, you will then lose the branching relationships across repos.

另一种选择是在公共GH回购上保留一个分叉-可能使其与GHE回购保持同步(手动或与cronjob同步).然后,您将拥有两个您的存储库实例,而公共实例将保留与原始存储库的分支关系.

The other option would be to keep a fork on the public GH repo--possibly keeping it in sync (manually, or with a cronjob) with your GHE repo. Then you'll have two instances of your repo, and the public one would retain branch relationships with the original repo.

取决于您为什么需要将其放在GHE上,它可能会起作用,也可能不会起作用.如果您要进行私人捐款,那么它显然将不起作用-因为您的私人捐款将不再是私人的.如果由于某些公司政策而希望在GHE上使用它,则内部使用的所有开源项目都保留在GHE上或类似的东西上,那么它将起作用,并增加了使回购在两个地方同步的管理开销.

Depending on why you need to put this on GHE, it may or may not work. If you're making private contributions, it clearly won't work--as your private contributions would no longer be private. If you want it on GHE due to some corporate policy that all open source projects used internally are kept on the GHE, or something similar, then it would work, with the added administrative overhead of keeping the repo in sync two places.

这篇关于是否可以将公共GitHub存储库派生到企业存储库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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