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 evn happens to be on Windows for whatever reason (Flutter, VSStudio, .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, untracked files, including nested files in untracked directories It intentionally does not do these things in v1: delete propagation, patch-apply checks, staging/index mirroring, global config

Prerequisites

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

Install

uv tool install .

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

Compatibility alias:

wdsync -f

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 previewed but skipped in v1 so they never break rsync, while 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>/.... In v1 it does not propagate deletes, 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.1.0.tar.gz (70.5 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.1.0-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wdsync-0.1.0.tar.gz
  • Upload date:
  • Size: 70.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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":null}

File hashes

Hashes for wdsync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 742788b201671c2e697e9c668d699f86ed0053991c88017b56c6dcb4c747138d
MD5 41060dc77a62f37951361a44f6ccc6ce
BLAKE2b-256 8a4234e924f926acfdec2a07d7c1a908261b3fdcd2ec4b205e437e16f2ece381

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wdsync-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 30.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","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":null}

File hashes

Hashes for wdsync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc777886ef4a7d3f5058412afaf440994203b8c70db30e2c04a8448193fc7712
MD5 4a4cfc5638e56a6e359db596a54c375b
BLAKE2b-256 626b79bd0a8cfe5fd48e41647b8144f60b4f0b0079ab537377b313ad7033ec8a

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