Skip to main content

shared-git-publish

Publish explicit Git work and advance shared checkouts while preserving local edits.

한국어 · Python 3.9+

License: MIT

Install · Quick start · Reference · Limits

Install

From the source directory, run pipx install . or uv tool install .. In an activated virtual environment, run python -m pip install ..

Use Git 2.38 or newer and Python 3.9 or newer. The package uses POSIX file locks. Install lsof to let it verify that an old index lock has no holder.

Quick start

In a temporary checkout called work, commit note.txt, push it to origin/main, and then edit it. These commands show the status fields from that example. The full JSON also carries commit IDs and recovery details.

$ shared-git-publish publish --repo work --path note.txt --message 'Update note' | jq -c '[.publication.status, .adoption.status]'
["published","adopted"]
$ shared-git-publish adopt --repo work --target origin/main | jq -c '.adoption.status'
"up_to_date"
$ shared-git-publish publish-commit --repo work --tip HEAD --path note.txt --no-adopt | jq -c '[.publication.status, .adoption.status]'
["up_to_date","skipped"]

Use separate working trees when each writer needs an independent index. Git worktrees provide that isolation in one repository. Jujutsu snapshots its working copy as a commit and supports separate workspaces. GitButler organizes parallel and stacked branches. This tool handles explicit publication from a shared checkout with the existing Git index and remote. Git worktree · Jujutsu working copy · GitButler

Reference

Command Effect
publish --repo R --path P --message M Build a commit on the remote tip with a private index. Repeat --path for each working file.
publish-commit --repo R --tip OID --path P Send the already-committed history leading to the tip. Repeat --path to name the unit's paths. Review the entire outgoing history before running this command.
adopt --repo R --target OID Advance the current branch to a locally resolvable commit. It can align patch-equivalent history and skips genuinely unpublished local commits.

Both publish commands default to --remote origin --branch main and support --no-adopt. For working files, --base records where you began editing and --source-root supplies a reviewed tree of owned bytes. Use --delete P to remove a file whose base version is still on the remote. Use --allow-empty when an empty file is the intended replacement for a nonempty one.

Read publication.status and adoption.status separately in schema version

  1. A publication can land even when the local checkout refuses to advance. The publish commands exit 0 on success or no change. A standalone adopt exits 0 when adopted or current, 2 when refused, and 3 when skipped. An unconfirmed push needs remote reconciliation before another attempt.

Adoption rehearses against a copy of the index. When it must retain staged intermediates, it writes backup refs under refs/shared-git-publish/backup/. Recognized automatic pairs expire after seven days. Pending recovery refs keep their payload until a later adoption can safely reconcile it.

Limits

A working-file publication cannot identify another writer's unstaged edits in the same file. Use a reviewed --source-root when edits overlap. Working-file publication accepts regular files and preserves their executable bit. Adoption can refuse overlapping edits, an active Git operation, or an index lock. The checkout holds those edits for you to resolve. The package has local macOS coverage and CI jobs for macOS and Linux.

Run the local Git fixtures when contributing. Contributing · MIT license

Metadata

Release files for shared-git-publish 0.1.0

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

Source distribution (sdist)

Source distribution for shared-git-publish 0.1.0
File Size Uploaded Provenance Actions
shared_git_publish-0.1.0.tar.gz 55.3 kB Without provenance Details for shared_git_publish-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for shared-git-publish 0.1.0
File Interpreter ABI Platform Actions
shared_git_publish-0.1.0-py3-none-any.whl Python 3 none any Details for shared_git_publish-0.1.0-py3-none-any.whl

Total release size: 89.7 kB

Release files / shared_git_publish-0.1.0.tar.gz

Download URL shared_git_publish-0.1.0.tar.gz
Size 55.3 kB
Tags Source
SHA-256 checksum
How to use checksums
33ee684374af3b15916191a4fee1bf07bbe7c97a6d173b0b178be3e259b82b90
BLAKE2b-256 checksum
How to use checksums
35ff96fd436db1b2e3356f21c70cd595ffe4ab46b2a6866ee1b9ea3247196248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Release files / shared_git_publish-0.1.0-py3-none-any.whl

Download URL shared_git_publish-0.1.0-py3-none-any.whl
Size 34.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32afac31f10c2f5f14af6907efd8b7bbd59c018e9220d92168c3c2f790d7a3de
BLAKE2b-256 checksum
How to use checksums
6ed4a2684cd390823dd39565955af2ad352fff0413216097c9761bff75a54d19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.8

Security for shared-git-publish 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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