对于开源项目来说,不共享生产设置有什么好的策略呢?

发布于 2025-01-01 22:02:15 字数 1436 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ぽ尐不点ル 2025-01-08 22:02:15

在与您类似的情况下,我需要公开发布零件并隐藏导入数据,我通常只是简单地保留一个仅用于生产的分支。

在此处输入图像描述

在您的情况下,您可以将发布所有内容的开发分支设为开源,克隆它并接收其他人的一些贡献。然后在不同的地方建立一个生产分支。 (赫罗库..)

In cases similar to yours where I need to publish parts publicly and keep import data hidden, I usually very simply keep a branch only for production.

enter image description here

In your case, you could either make the dev branch where you publishing everything open source, clone it and receive some contributions from other people. Then have a production branch somewhere different. (heroku..)

这样的小城市 2025-01-08 22:02:15

您通常不会将这些文件置于版本控制之下。例如,在公司内部,您可以将模板置于版本控制之下,并要求开发人员将其复制到位并根据需要进行更新。就像 config.ini.template 文件一样,

[smtp]
host = smtp.company.com
user = USERNAME # update this
pass = PASSWORD # and this

很明显,开发人员在将其重命名为 config.ini 时需要更新凭据。然后,config.ini 文件应从版本控制中排除。

对于开源项目,我可能不会将任何模板置于版本控制之下。我仍然会配置它,以便将 config.ini 文件排除在版本控制之外,这样我就可以在工作副本中拥有自己的 config.ini 文件,而无需通过以下方式提交它:事故。

我发现上述系统比将真实配置文件置于版本控制之下容易得多。即使我可以将它放在某种私有分支中,那么它也需要我不断地与该分支合并,并且我必须小心,不要意外地将配置文件推送到另一个存储库。

You normally don't put those files under version control. Inside a company, say, you can put a template under version control and ask your developers to copy it into place and update as necessary. Like a config.ini.template file with

[smtp]
host = smtp.company.com
user = USERNAME # update this
pass = PASSWORD # and this

where it's clear that the developers need to update the credentials when they rename it to config.ini. The config.ini file should then be excluded from version control.

For an open source project I would probably not put any template under version control. I would still configure it so that the config.ini file is excluded from version control so that I can have my own config.ini file in my working copy without committing it by accident.

I find the above system much easier than putting the real config files under version control. Even if I can put it in a private branch of some sort, then it will require me to constantly merge with that branch and I'll have to be careful not to accidentally push the config file to another repository.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文