从私人GitHub回购转向公共和私人 [英] Moving from Private GitHub Repo to Public and Private

查看:136
本文介绍了从私人GitHub回购转向公共和私人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GitHub上使用私人回购开发了一个客户项目。我们现在想要做的是打开它的某个部分,并产生一个开源版本的项目。这个想法是,客户的版本将建立在这一个。对开源版本所做的任何更改都应该也会流向私有版本。



现在,问题是我不能只将当前的GitHub repo设置为可见。有些代码应该只保留给客户。所以,对于一组实际的问题:


  1. 是否可以设置一对GitHub仓库,以便父项是公共的fork仍然是私有的?

  2. 我可以从repo中完全清除某些文件及其历史记录吗? (如果1.是可能的,我可以再次添加它们。)

我想我可以从头开始回购,然后基于这样的工作,但在这种情况下,我会失去一些宝贵的历史信息。



任何想法都会被赞赏。如果需要的话,我可以提供更多的细节。 你可以尝试将项目分成两部分,然后使用 git submodule 来连接它们。



私有的父项目可以包含一个公共的子模块项目。



请参阅 http://help.github.com/submodules/ 了解更多详情。


I've developed a customer project using a private repo at GitHub. What we want to do now is to open a certain part of it and produce an open source version of the project. The idea is that the customer's version will be built upon this one. Any changes made to the open source version should flow to the private one as well.

Now, the problem is that I cannot just set the current GitHub repo visible to all. There are certain pieces of code that should remain available only to the customer. So, to the actual set of questions:

  1. Is it possible to set up a pair of GitHub repos so that the parent is public while the fork remains private?
  2. Can I erase some files and their history from the repo entirely? (If 1. is possible, I could just add them there again.)

I guess I could start the repo from scratch and then work based on that but in that case I would lose some valuable history information.

Any ideas are appreciated. If needed I can provide you some more detail.

解决方案

You could try separating the project into two, then use git submodule to connect them.

The parent project which is private could hold a submodule project which is public.

See http://help.github.com/submodules/ for more details.

这篇关于从私人GitHub回购转向公共和私人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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