Skip to main content

Monorepo support built around git subtree.

Installation

pip install git_monorepo

Usage

Simply create a mapping file called monorepo.yml in the root of your git directory:

mappings:
  adhesive: git@github.com:germaniumhq/adhesive.git
  oaas:
    oaas: git@github.com:germaniumhq/oaas.git
    grpc-compiler: git@github.com:germaniumhq/oaas-grpc-compiler.git
    registry-api: git@github.com:germaniumhq/oaas-registry-api.git
    registry: git@github.com:germaniumhq/oaas-registry.git
    grpc: git@github.com:germaniumhq/oaas-grpc.git
    simple: git@github.com:germaniumhq/oaas-simple.git
  tools:
    git-monorepo: git@github.com:bmustiata/git-monorepo.git

Custom Branch

If you want to use a different branch name in all the remote repositories instead of the same name as the local branch, specify it as such:

mappings:
  # ...
branch: master

**Note**

This branch name applies for both pulling *and* pushing.

Squash Commits

subtree creates the commits, including merges into the upstream repos. This could severely pollute the history of the upstream repos. Because of this reason, squashing is implicitly enabled.

To disable squash the history into single commits, set the squash property:

mappings:
  # ...
squash: false

pull

To pull the repos (including initial setup), use:

git mono pull

In case upstream changes happened in the remote repos, so a pull is required before the push, use the --no-sync flag, so it won’t automatically merge and mark the changes as already synchronized to the remote repo.

Implicity having a pull should be done on a clean repo, and a pull --no-sync if upstream changes are present.

push

To push the repos do:

git mono push

This takes into account the current branch name, so pushes can happen also with branches.

At the end of the operation, if something was pushed, a new file to track the status named .monorepo.sync is created and committed automatically. This file holds a list of commits that were pushed, so your merges can also be dealed with correctly, by adding both entries when solving a potential conflict for a project.

mv

This renames the entry in the synchronized commits, and does the equivalent of:

git mv old/path new/path

With a special commit so git-subtree can find it.

Note

You still need to manually update the monorepo.yml manually with the new location.

Note

The feature is currently deemed unstable.

Metadata

Release files for git_monorepo 1.9.1

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_monorepo 1.9.1
File Size Uploaded
git_monorepo-1.9.1.tar.gz 8.8 kB Details

Release files / git_monorepo-1.9.1.tar.gz

Download URL git_monorepo-1.9.1.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9f0d9efa6a2d2ea8770cdb5104f7e098159ffeae5945c5c512916239b471953e
BLAKE2b-256 checksum
How to use checksums
a34506b67d6d58fa1a9e09441d026b8c638f36dda3207143b26acffce59889f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release history Release notifications | RSS feed

This release

1.9.1 This release

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.7.0

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.1

1 release file

1.2.0

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

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