带有配置文件的 Git 子模块
如果我想对 Git 存储库进行子模块:
https://github.com/shadowhand/paypal
...有一个配置文件:
https://github.com/shadowhand/paypal /blob/master/config/paypal.php
...如何在不提交我的配置文件版本的情况下为该项目做出贡献?
If I want to submodule a Git repository:
https://github.com/shadowhand/paypal
...that has a config file:
https://github.com/shadowhand/paypal/blob/master/config/paypal.php
...how do I contribute to the project without committing my version of the config file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
提交时,不要添加该文件:
在提交之前,请检查 git status 是否对配置进行了任何修改 - 如果您不小心进行了修改,请使用 git reset HEAD config /paypal.php 取消暂存它们。
(就其价值而言,这实际上与您将此存储库用作子模块的事实没有任何关系。)
When you commit, don't add that file:
Before committing, check with
git status
that you haven't staged any modifications to the config - if you accidentally have, usegit reset HEAD config/paypal.php
to unstage them.(And for what it's worth, this doesn't really have anything to do with the fact that you're using this repository as a submodule.)
刚刚发现 Kohana 建议您如何管理本地配置文件。
从数据库模块:
http://kohanaframework.org/3.1/guide/database/config
希望有帮助。
Just discovered how Kohana suggest you manage your local config files.
From the Database module:
http://kohanaframework.org/3.1/guide/database/config
Hope that helps.