If, as a way to integrate repositories, we consider a system of git submodules , then at least three options for organizing the structure are possible:
- create one repository in which files with translations for your modules will be decomposed into sub-directories like
module1 , module2 , etc., and connect it as a git-submodule, for example, to the translations directory in, for example, the root of the main repository. - create several repositories by the number of your modules and connect them as git-submodules to sub-directories in directories with your modules.
- create one repository (with the structure as in the first variant) and connect it as a git-submodule to each of the directories with your modules.
In any of these options, you will have to either tinker with the build scripts to indicate the changed paths to the files, or use symbolic links. but with symbolic links, as far as I know, there are some problems in, for example, the ms / windows operating system .
micro instructions for adding git submodules
To add a git repository (located at the url-репозитория ) as a submodule in the current repository (in which there should preferably not be uncommitted changes), run the following command in it:
$ git submodule add url-репозитория каталог/куда/добавлять
каталог/куда/добавлять should not exist at the time of the command - it will be created automatically.
after executing this command, the каталог/куда/добавлять and the new (or modified if you have already connected any sub- .gitmodules ) file .gitmodules will be automatically added to the index:
$ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # new file: .gitmodules # new file: каталог/куда/добавлять
these changes need to be committed. all submodule connected.
If necessary, you can send changes to the “main” repository using the push command. if the “main” repository is used not only by you, then after the pull command in the clones of this repository (with your commit that adds the submodule), you must also execute two commands — submodule init and submodule update :
$ git submodule init Submodule 'каталог/куда/добавлять' (url-репозитория) registered for path 'путь/куда/добавлять' $ git submodule update Cloning into 'путь/куда/добавлять'... done. Submodule path 'путь/куда/добавлять': checked out 'хэш коммита'