shared-git-publish
Publish explicit Git work and advance shared checkouts while preserving local edits.
한국어 · Python 3.9+
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
- A publication can land even when the local checkout refuses to advance.
The publish commands exit 0 on success or no change. A standalone
adoptexits 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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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
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.