Skip to main content

Mirror dirty files from a Windows Git repo into a matching WSL repo.

Project description

wdsync

wdsync is a WSL-side Python CLI for mirroring the dirty working tree of a Windows Git repository into a matching WSL repository without requiring a commit, push, or pull cycle.

It is built for the workflow where:

  • your primary editing happens to be on Windows for whatever reason (Flutter, VS Studio, .NET development, etc.)
  • your backend, scripts, containers, or Linux tooling run in WSL either for prod or testing parity
  • you want the WSL repo to mirror the current Windows dirty-set (staged and unstaged changes) on demand

The key design choice is that wdsync reads the source repo with git.exe, so the sync set matches what Git for Windows considers dirty rather than what Linux Git thinks about /mnt/c/....

What It Does

From inside a destination WSL repo, wdsync will:

  • read a local .wdsync file
  • resolve the Windows source repo from SRC=/mnt/c/...
  • query the source dirty set using git.exe (Windows Git)
  • preview by default to see the planned dirty set in the destination WSL repo
  • sync when you run wdsync sync or wdsync -f
  • warn with wdsync doctor when source and destination HEAD differ or the destination repo is already dirty

Note: It includes tracked unstaged files, tracked staged files, and untracked files, including nested files in untracked directories. Deleted files detected in the source are propagated to the destination (removed from the WSL repo). If a deletion fails due to permissions, wdsync prompts to retry with sudo. Files with local changes in the destination are never deleted. It does not yet do patch-apply checks, staging/index mirroring, or global config.

Prerequisites

Get git available in WSL and Windows (git.exe), plus rsync, wslpath, Python 3.11+, and either uv or pip; the source repo must be reachable as /mnt/<drive>/....

Install

uv tool install wdsync

Alternative install path with pip after python venv:

python -m pip install wdsync

Per-Project Config

Each destination WSL repo gets a local .wdsync file at the repo root:

SRC=/mnt/c/Users/YourName/path/to/WindowsRepo

Example:

SRC=/mnt/c/Users/<User>/Documents/Projects/<ProjectName>

wdsync init writes this file for you and adds .wdsync to the destination repo's .git/info/exclude so it stays local.

Quick Start

From inside the destination WSL repo:

wdsync init /mnt/c/Users/YourName/path/to/WindowsRepo
wdsync
wdsync sync

Doctor mode: Explain potential sync risks from source and destination state:

wdsync doctor

If you want to contribute or work on the codebase itself, use:

Additional references:

Project Layout

wdsync/
├── docs/
├── src/ [config, doctor, preview, shell, sync, sync, runner ...]
│   └── wdsync/
├── scripts/
│   ├── bash/
│   └── fish/
└── tests/

Commands

Command JSON Output Purpose
wdsync Yes, with wdsync --json Preview the current source dirty set.
wdsync preview Yes, with wdsync preview --json Explicit preview mode.
wdsync sync Yes, with wdsync sync --json Copy the planned dirty files into the current WSL repo.
wdsync init <SRC> No Create .wdsync for the current destination repo.
wdsync doctor Yes, with wdsync doctor --json Show advisory sync-risk checks for source and destination state.
wdsync shell install No Install optional shell helpers and completions.

Git Status Labels Passed

| [unstaged] [ M] | [staged] [M ] | [both] [MM] | [new] [??] | [added] [A ] | [added+mod] [AM] | [renamed] [R ] | [copied] [C ] | [deleted] [ D] | fallback [changed] |

Shell Integration

The CLI itself is shell-agnostic once installed. Optional shell helpers can be installed with:

wdsync shell install

Override shell detection when needed:

wdsync shell install --shell fish
wdsync shell install --shell bash
wdsync shell install --shell zsh

What shell install does:

  • auto-detects fish, bash, or zsh
  • installs completion assets
  • installs a wdsync-init helper wrapper
  • installs fish function delegates when using fish

The scripts/ directory contains thin repo-local wrapper examples that delegate to the installed CLI or fall back to uv run.

  • scripts/bash/ contains executable shell wrappers
  • scripts/fish/ contains fish functions
  • the bash wrappers also work fine as standalone executable helpers from zsh

Important Behavior Notes

Source dirty-file detection comes from git.exe, not Linux Git. Preview shows the full source dirty set rather than a destination diff, and sync copies file contents only. A source staged file does not remain staged in the destination repo. Deleted files are propagated to the destination: if a file was deleted in the Windows source, wdsync sync removes it from the WSL repo. Files that have local changes in the destination are skipped to avoid destroying local work. If a deletion fails due to file permissions, wdsync will prompt to retry with sudo. Renames and copies are parsed correctly from porcelain v1 -z and untracked directories are expanded to leaf file paths.

Limitations

wdsync is WSL-only, supports one source path per destination repo, and expects the source path to live under /mnt/<drive>/.... It does not yet run patch-apply checks or support post-sync hooks.

See IN_DEVELOPMENT.md for the roadmap beyond the current Python CLI baseline.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wdsync-0.2.0.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wdsync-0.2.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file wdsync-0.2.0.tar.gz.

File metadata

  • Download URL: wdsync-0.2.0.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wdsync-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9ee216ba1dd683d65125d39e803e9dbfa4cbde9e27e95ab36d4f46e07175c3da
MD5 dc42812b5ef10b4c9d1d2c034cd1d481
BLAKE2b-256 35d9e3163d653f35a582dd8008948ba940e8d72098c198324ddef36d49fb5c0c

See more details on using hashes here.

File details

Details for the file wdsync-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: wdsync-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for wdsync-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd08f34ecf547d95cee496eee71d81f8ddc1d51a0c01438a11a714a5696e4b49
MD5 298ffd56fbc2bac86de3c6686935f25b
BLAKE2b-256 896828c78db06960d210a5e0df42675f54e2bcf30de2af10ba7868df073a78b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page