Get Started

No-Sweat Submodules

Git was intended to be modular; the idea is to have developers create a separate repository for each project. Unfortunately, its built-in tool for sharing code between projects, Git Submodules, requires a lot of attention and is easy to break. This is why most teams tend to avoid using it and give up the advantages of the modular approach.

We decided to fix this situation and designed a tool for working with modules in Git that is awesome and easy to use. See for yourself!

No-Sweat Submodules

Git was intended to be modular; the idea is to have developers create a separate repository for each project. Unfortunately, its built-in tool for sharing code between projects, Git Submodules, requires a lot of attention and is easy to break. This is why most teams tend to avoid using it and give up the advantages of the modular approach.

We decided to fix this situation and designed a tool for working with modules in Git that is awesome and easy to use. See for yourself!

A submodule is a special entry in a project tree, linked to a certain commit in another repository.

An X-Module is a regular directory, synced with another repository on the Git server.

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 create a branch, you have to create it separately in each submodule and in the main project repository.

A branch is created simultaneously in the project repository and all synced module repositories.

To pull the updates from the Git server, you have to fetch them separately for each submodule and then commit the updated link to the main project.

Git X-Modules fetches all updates from module repositories
automatically, so users receive everything with one git pull

Code review has to be done separately for each submodule. You can’t diff all changes if some of them are in other repositories, linked as submodules.

Code review can be done for the complete project with related X-Modules at once. All changes can be seen in one list.

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.

Working with submodules requires learning specific commands and using them in the correct order.

For the end-users, a repository with X-Modules is just a regular repository that requires no special attention.

Many tools that integrate with Git (code review systems, task trackers, and IDEs) do not recognize submodules or have proper support for them in the GUI.

For any third-party tool, a repository with X-Modules is just a regular repository and is recognized as such.

Would you like to learn more?

Contact us or start using Git X-Modules and see for yourself!

contact us start using Git X-Modules