hpsync = hpc + sync
hpsync safely synchronizes
uncommitted Git work across any number of worktrees on your local computer
and SSH-accessible machines.
It is designed for work that is not ready to commit but needs to follow you between a laptop, workstation, login node, or compute site. Each worktree is assumed to be at the same commit.
Safety model
Before changing anything, hpsync:
- verifies that every worktree is based on the same Git commit;
- detects active merges, rebases, cherry-picks, and similar operations;
- hashes every changed file at every location;
- blocks paths that were changed differently in multiple places;
- shows the complete transfer plan and asks for confirmation;
- creates a compressed backup at every location that will be modified;
- verifies that all worktrees converge after the transfer.
Files are copied directly between worktrees. Paths sharing a source and target
are packed into one tar stream, avoiding an SSH round trip for every file.
hpsync does not commit, pull, push, reset, or modify Git history.
Install
Python 3.10 or newer is required on the computer running hpsync. SSH
locations need python3, git, and tar.
pip install hpsync
The command is installed as hpsync.
Configure
Run the interactive setup:
hpsync config
The wizard separates each question with a terminal-width dim gray rule and
explains each value as it asks for it. Type back at any question to discard
the previous answer and ask that question again. In short:
- Repository name is a label for the project, such as
pimm. - Location name is a label for a computer or site, such as
local,nersc, ors3df. - Transport is
localfor a path on this computer orsshfor another machine. - Repository path is where the Git checkout exists or should be created on that machine.
- Backup path is where safety archives are stored before files are replaced.
Setup always adds a location named local. At least one configured location
must already contain the repository, but the local copy or any remote copy may
be missing. The wizard detects missing checkouts and offers to clone them from
an existing location using a temporary Git bundle. An existing checkout does
not need a Git origin for this initial bootstrap.
The default configuration is ~/.config/hpsync/config.json. Override it with
HPSYNC_CONFIG or the global --config PATH option.
You can also build the configuration without the wizard:
hpsync config add-repo my-project
hpsync config add-location my-project laptop \
--local \
--path ~/code/my-project
hpsync config add-location my-project workstation \
--ssh workstation \
--path ~/code/my-project
hpsync config add-location my-project cluster \
--ssh user@login.example.org \
--path /work/user/my-project \
--state /scratch/user/hpsync
For a site that needs a credential refresh command, configure it explicitly:
hpsync config add-location my-project nersc \
--ssh nersc \
--path /global/u1/u/user/my-project \
--state /pscratch/sd/u/user/hpsync \
--auth-command sshproxy
Useful configuration commands:
hpsync config show
hpsync config validate
hpsync config path
hpsync config bootstrap
hpsync config remove-location my-project cluster
hpsync config remove-repo my-project
The generated JSON is intentionally straightforward and can be edited by hand:
{
"version": 1,
"repositories": [
{
"name": "my-project",
"locations": [
{
"name": "laptop",
"transport": "local",
"path": "~/code/my-project",
"state": "~/.local/state/hpsync"
},
{
"name": "cluster",
"transport": "ssh",
"host": "user@login.example.org",
"path": "/work/user/my-project",
"state": "/scratch/user/hpsync"
}
],
"exclude_parts": [".git", ".venv", "__pycache__"],
"exclude_names": [".env"]
}
]
}
exclude_parts matches a directory or path component anywhere in the
repository. exclude_names matches an exact file name. Add generated data,
logs, checkpoints, or secrets that should never move between machines.
Use
Inspect all configured repositories without changing anything:
hpsync status
Review, back up, synchronize, and verify:
hpsync sync
Limit an operation to named repositories or locations:
hpsync status my-project --verbose
hpsync sync my-project --location laptop --location workstation
Use --yes for an already-reviewed, non-interactive synchronization:
hpsync sync my-project --yes
How conflicts are decided
For each dirty path, all configured locations are compared. If one file state is the only changed version, it is copied to every location that differs. If several locations contain the same changed version, they agree and that version still propagates. If changed locations disagree, the path is reported as a conflict and the synchronization is blocked.
If locations have different HEAD commits, you must align them with your normal Git workflow before running
hpsync again.
Development
python -m pip install -e .
python -m unittest discover -v
License
MIT
Metadata
Release files for hpsync 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hpsync-0.2.1.tar.gz | 31.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hpsync-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.5 kB
Release files / hpsync-0.2.1.tar.gz
| Download URL | hpsync-0.2.1.tar.gz |
|---|---|
| Size | 31.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce3b9ea5cbecdef3c43f0012f025a3975dd193865e46863a0c7174e609c14e8f
|
|
BLAKE2b-256 checksum How to use checksums |
98d09699b571ee23e1a536a8e9c3f6a54569c8cc0ae3ec751fe9ba3c4ae64235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 4, 2026.
Transparency logRelease files / hpsync-0.2.1-py3-none-any.whl
| Download URL | hpsync-0.2.1-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bdf28a876cded53cc96920971c920d54f476abdf58e42fa4f73175ce2b151478
|
|
BLAKE2b-256 checksum How to use checksums |
aeb78e1fba6973a6a7b9794f1f963a7b52b67f1802826e93fca9c943a1f2e781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 4, 2026.
Transparency log