This may be terrible, I am not sure.
Let us say we have a repo "product" with a working directory
/product /product/command.script /product/config/ (bare git repo) And a repo "config" with a working directory
/config /config/config.json The command.script file has actions to interact with a bare repo. ex. Running command.script BRANCH1 would run the command
git show BRANCH1:config.json Is there any way that the "/product/config/" folder can be a submodule of the "product" repo, such that when the "product" repo is cloned the "config" repo will also be cloned
git clone --bare [config origin here] config from its origin and when the "product" repo is fetched, the "/product/config" submodule can be fetched
git fetch origin '*:*' Or is this something that should be handled through hooks of some sort?
--mirroroption is available only in a bare variant, so you have to clone twice: as a bare repository and as not bare.