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
.wdsyncfile - 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 syncorwdsync -f - warn with
wdsync doctorwhen source and destinationHEADdiffer 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,
wdsyncprompts to retry withsudo. 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
- Read the detailed Setup guide here | Recommended install path:
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:
- DEVELOPER_SETUP for contributor environment setup
Additional references:
- CHANGELOG for release history
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, orzsh - installs completion assets
- installs a
wdsync-inithelper 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 wrappersscripts/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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wdsync-0.3.0.tar.gz.
File metadata
- Download URL: wdsync-0.3.0.tar.gz
- Upload date:
- Size: 49.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8df55a9d785085c0c59515e27320d8549c8b6bdb452dec5da6b933590f9283e
|
|
| MD5 |
e6a1e73c4ad24e9ca7e315848fda59ce
|
|
| BLAKE2b-256 |
fd01ca80913eafaafd68371ab1871499fc6839fe3c4f186c5e4919ea612e59a7
|
File details
Details for the file wdsync-0.3.0-py3-none-any.whl.
File metadata
- Download URL: wdsync-0.3.0-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d00934e60d9a0af87d8d85c50f6cbbbbbefb3fab4989876e02d996e8afd589bc
|
|
| MD5 |
5c590b70280d09ae5e3673a6e4699cc1
|
|
| BLAKE2b-256 |
5df202791335de04572244ee8f3e3a6caab5d3d188bd091b314b6e64772d1b05
|