什么git设置和命令可以帮助管理公共Github上的私人内容? [英] What git setup and commands can help managing private content on a public Github?

查看:105
本文介绍了什么git设置和命令可以帮助管理公共Github上的私人内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在PHP中构建了一个CMS(轻松使用),我通过 Github回购。我正在建设它,因为我公司的新主页和其各种形式的内容为如何使用各种类别和功能提供了一个很好的例子。首先,我将我的内容留在那里(全部以Markdown文本文件存储) - 关于页面,客户端示例,博客文章 - 但后来被吓到了,并加入了Lorem石膏和假图像。出于某种原因,即使这些内容都可以在我们的网址上公开使用,但是让设计,内容和其他所有内容都可以轻松访问,这只是一个糟糕的主意。尽管如此,(a)很高兴能够在一个回购中拥有所有东西,(b)一个伟大的姿态表示嘿,我的东西是你的,特别是因为我们专注于开源,并且(c)只是使已有的东西成为可能(窃取我们的设计和内容)只会稍微简单一些。



有没有什么办法让git仓库可以管理(半)私人内容,同时仍然在公共仓库发布?

解决方案

详见可以在github上托管的源代码是否是封闭源代码?


GitHub本身没有任何东西与你如何许可你的代码有关。因此,您可以决定停止通过GitHub发布您的源代码,但是当前使用的开源许可证下的所有分支和克隆资源当然仍然不存在。


所以更重要的是:


  • 辅助功能:是否重要每个人都可以访问/读取您的代码?

  • 授权:您对该回购的内容附加了什么样的许可?



我宁愿单独保存:


  • 模板文件(相当于您的Lorem Ipsum文件)

  • 脚本文件能够从值文件本身生成实际有价值的文件


公司数据)。
我将那些远离GitHub存储。



这样,我可以声明一个内容过滤器驱动程序,在结帐时,会自动为我生成最终文件。





(请参见自动忽略所选代码更改推送到git-hub存储库时for more)


I'm building a "CMS" (used lightly) in PHP which I'm providing as open source via a Github repo. I'm building it as the new homepage for my company and the content in its various forms provide a nice example on how to use the various classes and functions.

At first, I left my content in there (all stored as Markdown text files) - about pages, client examples, blog posts - but then got scared and added in Lorem Ipsum and fake images. For some reason, even though this will all be available to the public at our URL, it just felt like a bad idea to have the design, content, and everything else so easily accessible. Still, it would be (a) nice to have everything in one repo, (b) a great gesture to say "hey, what's mine is yours," especially since we concentrate on open source, and (c) just makes what's already possible (stealing our design and content) only slightly easier.

Is there any way a git repo can manage (semi-)private content while still publishing it on a public repo?

解决方案

As detailed in "Can open source code hosted at github be closed-source?":

GitHub itself has nothing to do with how you license your code. So you can decide to stop publishing your source via GitHub, but everything that has been forked and cloned from it up to that point is of course still "out there" under the open source license you originally used.

So it is more about:

  • accessibility: does it matter that everyone can access/read your code?
  • licensing: what kind of license do you attach to the content of that repo?

I prefer keeping separate:

  • template files (the equivalent of your Lorem Ipsum files)
  • script files able to generate the actual valued files

from the value files themselves (the files with the actual "company" data).
I store those ones away from GitHub.

That way, I can declare a content filter driver which, on checkout, will automatically generate the final files for me.

(See "Automatically ignore selected code changes when pushing to a git-hub repository" for more)

这篇关于什么git设置和命令可以帮助管理公共Github上的私人内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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