To clone a repository with submodules, one has to run a sequence of commands:
git clone git://example.org/repos.git
git submodule init
git submodule update
or
git clone --recurse-submodules
A submodule is a link to a certain commit. It can’t be linked to a subdirectory within that commit, or filter some paths out of this commit.
A repository with X-Modules is just a regular repository and can be cloned with a git clone
An X-Module can be synced with any subdirectory of another repository. One can also excl ude some files from the sync using a path pattern.
To push the updates, one has to:
- Push to each submodule first
- Commit the updated link to the main project
- And only then push the updates to the project itself
Failing to follow this sequence causes errors and may even result in losing some code.
With Git X-Modules, all updates are sent with one atomic git push The files are distributed between repositories on the server's side.
To push the updates, one has to:
- Delete the relevant line from the .gitmodules file
- Delete the relevant section from .git/config
- Run git rm --cached path_to_submodule
- Commit and delete the now untracked submodule files
To remove an X-Module, simply delete the corresponding directory in the main project.
Contact us or start using Git X-Modules and see for yourself!