在使用git的项目中,对于需要各自修改的配置文件,该怎么管理
给我你的怀抱
给我你的怀抱 2017-04-27 09:03:39
0
1
577

例如现在的项目的配置文件为config.inc
其中有开发者在本地配置时需要修改的文件路径等参数,各人不同。
我想要在版本控制上保存一份值为空的初始配置,能够clone下来。
而各人修改后在提交时都将其忽略掉,始终不覆盖线上的config.inc
(这里不算各人自行设置的忽略,而是想要设置为统一的效果)

具体应该怎么来完成这个管理?通过gitignore应该怎么写?

git学习使用中,现在不太明白是因为我将config.inc从版本控制中删除(git rm --cached)时,commit再push到服务器后,好像上面的config.inc也一并删除了。

给我你的怀抱
给我你的怀抱

reply all(1)
刘奇

You can write two copies, one as standard, config.inc.dist, and put config.inc into .gitignore


As for the latter question, you should ignore config.inc when creating the project. Now it is normal to delete it on the server. Just create another one on the server and it will be OK.


Git For the management of configuration files, generally the common configuration is used as a backup (for example, followed by a suffix such as .dist or .bak) and put into git management, and everyone's own configuration is ignored.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template