Skip to main content

git-nested

logo

An alternative to git-submodule and git-subtree for managing nested repositories.

Test Docs codecov Quality Gate Status PyPI License: MIT Python 3.10+

📖 Documentation: https://thorsten-klein.github.io/git-nested/

What is git-nested?

git-nested puts another git repository into a folder of your repository. The files are ordinary files in ordinary commits. You can still pull new changes from the other repository, and push your changes back to it.

git nested clone https://github.com/user/lib ext/lib   # copy it in
git nested pull ext/lib                                # get new upstream changes
git nested push ext/lib                                # send your changes back
git nested status                                      # see where everything stands

A small .gitnested file in the folder remembers the URL, the branch and the upstream commit. So the commands stay short.

Your repository has submodules already? Turn them all into nested repositories, and keep following upstream:

git nested submodules init --recursive
git fetch origin
git nested submodules update origin/main

Why git-nested?

  • Self-contained. Your repository has all files. A plain git clone gets everything. No access to the other repositories is needed.
  • Simple. The commands feel like git.
  • Clean history. By default one pull is one commit.
  • Flexible. Each branch can have its nested repositories in another state.
  • Safe to try. Everything is a normal commit. git reset undoes it.

Only people who pull or push nested repositories need git-nested. See Compared to submodule and subtree.

Install

pip install git-nested

git 2.23 and Python 3.10 or newer are needed. There is also a standalone executable that needs no Python. See Install git-nested for all ways, shell completion and the manual page.

Documentation

The full documentation is in doc/, and online at https://thorsten-klein.github.io/git-nested/.

Help on the command line:

git nested --help          # the manual page
git nested pull --help     # one command: what it does, its options, examples

Contributing

Pull requests are welcome. See Development for the setup and the checks. The short version:

uv sync          # install everything
uv run poe all   # every check CI runs

Report security problems as described in SECURITY.md.

Authors

git-nested:

  • Thorsten Klein - Python rewrite and enhancements

Original git-subrepo authors:

  • Ingy döt Net - Original concept and implementation
  • Magnus Carlsson - Contributor
  • Austin Morgan - Contributor

License

MIT. See LICENSE.

Acknowledgments

This project is based on git-subrepo by Ingy döt Net. git-nested is a Python rewrite with some modified features and improvements.

Metadata

Release files for git-nested 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-nested 1.2.2
File Size Uploaded Provenance Actions
git_nested-1.2.2.tar.gz 383.9 kB With provenance Details for git_nested-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for git-nested 1.2.2
File Interpreter ABI Platform Actions
git_nested-1.2.2-py3-none-any.whl Python 3 none any Details for git_nested-1.2.2-py3-none-any.whl

Total release size: 502.1 kB

Release files / git_nested-1.2.2.tar.gz

Download URL git_nested-1.2.2.tar.gz
Size 383.9 kB
Tags Source
SHA-256 checksum
How to use checksums
381ef4a1c03000b5452cbac83fccb225c75de28a02d1039e762fec1532af3465
BLAKE2b-256 checksum
How to use checksums
078c390bf026d7e08937be60d7c01abd2fb45c7448e99992dac8417dcc31da43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Release files / git_nested-1.2.2-py3-none-any.whl

Download URL git_nested-1.2.2-py3-none-any.whl
Size 118.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
77e863553b5ac92e7c4fda2fc63d449d2760473b96b8f17ed6484267659e6310
BLAKE2b-256 checksum
How to use checksums
617e8373ea7f028c72f6414a27ef4207d9b433f603c8cd4fdb991197acd4e742
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

Security for git-nested 1.2.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for git_nested-1.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 14, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page