File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -199,3 +199,32 @@ Configuring Git this way includes `.gitconfig.local` in the standard
199199` .gitconfig ` . yadm will automatically link the correct version based on the
200200operating system. The bulk of your configurations can go in a single file, and
201201you just put the exceptions in OS-specific files.
202+
203+ ## Submodule alternates
204+
205+ Git submodules can be conditionally enabled using a [ conditional git-config
206+ include] [ git-config-includes ] and the ` submodule.active `
207+ [ configuration] [ gitsubodules-active ] .
208+
209+ 1 . Add the submodule as usual: ` yadm submodule add <url> <name> `
210+ 2 . Add the following to ` $HOME/.gitconfig ` to include a config only for the
211+ specific repository:
212+
213+ ``` ini
214+ [includeIf " gitdir:~/.local/share/yadm/repo.git" ]
215+ path = .gitconfig.submodules
216+ ```
217+ 3. Set up `.gitconfig.submodules` to be an alternate or template file that
218+ e.g. contains this on the system where you don' t want the submodule checked
219+ out:
220+
221+ ```ini
222+ [submodule]
223+ active = *
224+ active = :!<name>
225+ ```
226+ 4. Run `yadm submodule update` from the [bootstrap](bootstrap) program to check
227+ out all active submodules.
228+
229+ [git-config-includes]: https://git-scm.com/docs/git-config#_conditional_includes
230+ [gitsubodules-active]: https://git-scm.com/docs/gitsubmodules#_active_submodules
You can’t perform that action at this time.
0 commit comments