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.3

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.3
File Size Uploaded Provenance Actions
git_nested-1.2.3.tar.gz 387.8 kB With provenance Details for git_nested-1.2.3.tar.gz

Built distribution (wheel)

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

Total release size: 507.1 kB

Release files / git_nested-1.2.3.tar.gz

Download URL git_nested-1.2.3.tar.gz
Size 387.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5856b2427bc147c2c4b0878da26732f55886d5eb6ea57613e06eb1317a69e5b7
BLAKE2b-256 checksum
How to use checksums
95606704ca76a957c652e91df8f02ba0b582f9f06ba2ec0d6533ad3036e760cb
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 29, 2026.

Transparency log

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

Download URL git_nested-1.2.3-py3-none-any.whl
Size 119.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1beaf1f49556323755079beca086436710c88b2bcba9ba71ee7a8664fbb2a198
BLAKE2b-256 checksum
How to use checksums
896b584e640e76f69b6cd9e5c12af0cbfd948806048d279cce403f70652bdaaa
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 29, 2026.

Transparency log

Security for git-nested 1.2.3

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.3.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 29, 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