Git Submodule Flow (smflow) is a lightweight toolset and set of Git hooks designed to make working with Git submodules significantly easier. It helps keep submodules in sync with the parent repository, enabling a "virtual monorepo" workflow — without giving up the benefits of repository modularity.
Report Bug
·
Request Feature
🚀 Features
- Intuitively work with submodules through VS Code git interface.
- Automatically attaches submodule
HEADs to the commits referenced by the parent repository. - Quickly see how many changes the current submodule is behind the tracked branch.
- Correctly set local submodules when switching branches in the parent project.
- Automatically update
.gitmodulesin parent when changing locally checking out branches for submodules.
📦 Installation
Note: Requires
uvto be installed.
Install smflow with:
uv tool install smflow
🛠️ Usage
From the root of your parent repository (the one that contains submodules), run:
smflow init
This will configure your repository with the appropriate Git settings and install the necessary hooks.
For help and available commands, run: smflow --help:
usage: smflow [-h]
{init,install-hooks,configure-git,attach-heads,sync-from-local}
...
Make the flow of working with Git submodules smoother.
positional arguments:
{init,install-hooks,configure-git,attach-heads,sync-from-local}
command to run
init Setup all functionality of smflow.
install-hooks Installs the githooks.
configure-git Configures some ergonomic settings for git submodules
in local `.gitconfig`.
attach-heads Attaches the head of the submodules to the branch and
reset to the commit-sha.
sync-from-local Updates .gitmodules from local file state.
options:
-h, --help show this help message and exit
🔍 What smflow init Does
🔗 Git Hooks
The following hooks will be installed:
- Post-checkout hook parent: Automatically attaches to branch and resets submodules to the correct commit when you checkout a branch in the parent repository.
- Post-Checkout hook submodules: Updates
.gitmoduleswhen you switch between branches in the children, ensuring easy updates.
⚙️ Git Configuration
smflow sets these recommended Git config values:
git config submodule.recurse true
Ensures submodules are automatically checked out when switching branches.
git config push.recurseSubmodules on-demand
Allows pushing submodule commits automatically when pushing the parent repository — if the submodules and parent share the same branch name. If not, Git will warn and suggest pushing submodules first.
⚠️ Limitations
- smflow does not currently support recursive submodules, i.e. submodules within submodules.
🧩 Why smflow?
Managing submodules manually is tedious and error-prone. smflow minimizes the overhead and makes it easier to:
- Stay in sync with your team
- Avoid detached HEAD states in submodules
- Prevent pushing parent branches that reference unpublished submodule commits
Whether you’re working with multiple shared libraries or simply trying to tame Git submodules, smflow provides a smoother, safer workflow.
Metadata
Release files for smflow 0.3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smflow-0.3.8.tar.gz | 3.7 MB | Without provenance | Details for smflow-0.3.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smflow-0.3.8-py3-none-any.whl | Python 3 | none | any | Details for smflow-0.3.8-py3-none-any.whl |
Total release size: 3.7 MB
Release files / smflow-0.3.8.tar.gz
| Download URL | smflow-0.3.8.tar.gz |
|---|---|
| Size | 3.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c2b9dfece4960c412f56f838303dce592139e812516f4bc7b95fe18c7fefddc8
|
|
BLAKE2b-256 checksum How to use checksums |
86e954718ed12b7ecea79d0fbc31693102d0119d2eb0ba104b5507d23ec68453
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.8
|
Release files / smflow-0.3.8-py3-none-any.whl
| Download URL | smflow-0.3.8-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a6bb176c7145cec40467be17b0c4ee73ab1810efe42530776c05a1c072ddd40
|
|
BLAKE2b-256 checksum How to use checksums |
cd83d20bbf20c5aaf1b73588291d406c2af028dea3411159815ef3913c0a39ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.8
|
Security for smflow 0.3.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.