How to track config files of submodules in Git?

前端 未结 2 617
甜味超标
甜味超标 2020-12-11 19:27

In Git, how can I organize work to track local config files of a library, which is a git submodule?

In details:

the library has normal files

2条回答
  •  囚心锁ツ
    2020-12-11 19:55

    When using a submodule, you should avoid making any modification because of the container (here: the project using the lib), because it will create a new revision on the history of the submodule.

    It would be possible, for instance, for the lib, to reference config template files that can be the base for :

    • default value config files generation (the lib has a default value file archived, which can be used to generate a complete but not tracked config file)
    • or a custom config file generation (the project has its own config file values, and use it to generate at the same place within the lib a non-tracked config file)

    A "config file template with tokenized values in it, and a script transforming that config.template file into a private (and ignored) config file" is the approach I suggested in this SO question about merge management.

    Other more general advices on config files can be found in this SO question.

提交回复
热议问题