11# wpush
2- Clone repos on Windows, push to WSL. Zero-config bridge between worlds.
3- [ ![ GitHub stars] ( https://img.shields.io/github/stars/0xA672/wpush?style=social )] ( https://github.com/0xA672/wpush/stargazers )
42
3+ ** Clone repositories on Windows, push to WSL.**
4+ Zero-config bridge between two worlds.
5+
6+ [ ![ GitHub stars] ( https://img.shields.io/github/stars/0xA672/wpush?style=social )] ( https://github.com/0xA672/wpush/stargazers )
57[ ![ Crates.io] ( https://img.shields.io/crates/v/wpush-git.svg )] ( https://crates.io/crates/wpush-git )
68[ ![ License] ( https://img.shields.io/crates/l/wpush-git.svg )] ( https://github.com/0xA672/wpush/blob/main/LICENSE )
9+ [ ![ CI] ( https://github.com/0xA672/wpush/actions/workflows/ci.yml/badge.svg )] ( https://github.com/0xA672/wpush/actions/workflows/ci.yml )
710
11+ ---
812
913## Why wpush?
1014
11- Sometimes you clone a repo on Windows (e.g., from VS Code, File Explorer, or a Windows terminal) but want to work with the code inside WSL. Manual copying and path conversion is annoying.
15+ Sometimes you clone a repository on Windows (e.g., from VS Code, File Explorer, or a Windows terminal) but need to work with the code inside WSL.
16+ Manually copying and converting paths is tedious—` wpush ` automates it in one command.
1217
1318## Prerequisites
19+
1420- Windows 10/11 with [ WSL2] ( https://learn.microsoft.com/en-us/windows/wsl/install ) installed
15- - [ Rust] ( https://www.rust-lang.org/tools/install ) (if building from source)
16-
21+ - [ Rust] ( https://www.rust-lang.org/tools/install ) (only if building from source)
1722
1823## Installation
1924
2025### Pre-built binaries (recommended)
2126
22- Download ` wpush.exe ` from [ Releases] ( https://github.com/0xA672/wpush/releases ) and place it in a directory in your ` PATH ` .
27+ Download ` wpush.exe ` from the [ Releases] ( https://github.com/0xA672/wpush/releases ) page and place it in a directory that is on your ` PATH ` .
2328
2429### Using Cargo
2530
2631``` shell
2732# From crates.io
2833cargo install wpush-git
29- ```
30- ``` shell
34+
3135# From source
3236git clone https://github.com/0xA672/wpush.git
3337cd wpush
3438cargo install --path .
3539```
3640
37- ### Using PowerShell
41+ ### Using PowerShell (one‑liner)
3842
39- Copy and paste the entire script into a ** PowerShell** window ( Administrator rights are * not* required unless you choose ` C:\Windows ` as the install directory) .
43+ Copy and paste the entire script into a ** PowerShell** window. Administrator rights are * not* required unless you choose ` C:\Windows ` as the installation directory.
4044
4145``` powershell
42- # Download the latest wpush.exe
4346$url = "https://github.com/0xA672/wpush/releases/latest/download/wpush.exe"
4447$tempFile = "$env:TEMP\wpush.exe"
4548Invoke-WebRequest -Uri $url -OutFile $tempFile
46-
47- # Remove "Mark of the Web" to prevent SmartScreen blocking
4849Unblock-File -Path $tempFile
4950
50- # Choose installation directory (must be in your PATH, or you will be warned)
5151$destDir = "$env:USERPROFILE\.cargo\bin"
5252if (-not (Test-Path $destDir)) {
5353 New-Item -ItemType Directory -Path $destDir -Force | Out-Null
5454 Write-Host "Created directory: $destDir" -ForegroundColor Cyan
5555}
56-
57- # Move the executable
5856Move-Item -Path $tempFile -Destination "$destDir\wpush.exe" -Force
5957
60- # Verify the destination is in PATH
6158$paths = $env:PATH -split ';'
6259if ($paths -notcontains $destDir) {
6360 Write-Warning " $destDir is NOT in your system PATH."
@@ -71,42 +68,49 @@ if ($paths -notcontains $destDir) {
7168Write-Host " wpush installed to $destDir\wpush.exe" -ForegroundColor Green
7269Write-Host ""
7370Write-Host " IMPORTANT: Close and reopen your terminal, or refresh environment variables." -ForegroundColor Yellow
74- Write-Host " (If you have Chocolatey, you can run 'refreshenv')"
71+ Write-Host " (If you use Chocolatey, you can run 'refreshenv')"
7572Write-Host "After that, try running: wpush --help"
7673```
77- ### Usage
74+
75+ ## Usage
76+
7877``` shell
7978wpush [OPTIONS] < REPO_URL> < DEST_PATH>
8079```
81- ## Options
8280
83- | Option | Description |
84- | --------| -------------|
85- | ` -d, --distro <DISTRO> ` | WSL distribution name (default: ` Ubuntu ` ) |
86- | ` -b, --branch <BRANCH> ` | Git branch to clone |
87- | ` -u, --user <USER> ` | WSL username (auto-detected via ` wsl whoami ` if omitted) |
88- | ` -h, --help ` | Show help message |
89- | ` -V, --version ` | Show version information |
90- | ` -k, --keep-git ` | Preserve the ` .git ` directory during copy (keeps full Git history) |
81+ ### Options
82+
83+ | Option | Description |
84+ | ----------------------------| --------------------------------------------------------------------------|
85+ | ` -d, --distro <DISTRO> ` | WSL distribution name (default: ` Ubuntu ` ) |
86+ | ` -b, --branch <BRANCH> ` | Git branch to clone |
87+ | ` -u, --user <USER> ` | WSL username (auto‑detected via ` wsl whoami ` if omitted) |
88+ | ` -k, --keep-git ` | Preserve the ` .git ` directory (keeps full Git history) |
89+ | ` -n, --dry-run ` | Preview actions without actually cloning or copying |
90+ | ` -h, --help ` | Show help message |
91+ | ` -V, --version ` | Show version information |
9192
92- ## Destination Path Formats
93+ ### Destination Path Formats
9394
94- ` wpush ` supports two types of destination paths inside WSL:
95+ ` wpush ` supports two kinds of destination paths inside WSL:
9596
96- | Format | Expands to |
97- | --------| ------------|
98- | ` ~/myproject ` | ` /home/<username>/myproject ` |
99- | ` ~ ` | ` /home/<username> ` |
100- | ` /absolute/path ` | Used as- is (must exist or be creatable) |
97+ | Format | Expands to |
98+ | ------------------- | ------------------------------------------ ------------|
99+ | ` ~/myproject ` | ` /home/<username>/myproject ` |
100+ | ` ~ ` | ` /home/<username> ` |
101+ | ` /absolute/path ` | Used as‑ is (must exist or be creatable) |
101102
102- The username is automatically detected by running ` wsl -d <distro> whoami ` unless overridden with ` --user ` .
103+ The username is automatically detected by running ` wsl -d <distro> whoami ` unless you override it with ` --user ` .
103104
104105## Examples
105106
106107``` powershell
107108# Clone into auto-detected user's home directory
108109wpush https://github.com/user/repo.git ~/repo
109110
111+ # Preview what would happen (dry run)
112+ wpush https://github.com/user/repo.git ~/repo --dry-run
113+
110114# Clone a specific branch
111115wpush https://github.com/user/repo.git ~/repo -b develop
112116
@@ -119,15 +123,31 @@ wpush https://github.com/user/repo.git /home/cero/projects/repo
119123# Clone with full Git history preserved
120124wpush https://github.com/user/repo.git ~/repo --keep-git
121125```
126+
122127## How It Works
123128
124- 1 . ** Git clone** – The repository is cloned into a temporary Windows directory, with transfer progress shown in the terminal.
129+ 1 . ** Git clone** – The repository is cloned into a temporary Windows directory, with transfer progress displayed in the terminal.
1251302 . ** Path resolution** – The destination path is expanded:
126131 - ` ~ ` and ` ~/... ` are converted to ` /home/<username>/... ` using the detected or specified WSL user.
127132 - Absolute paths are kept unchanged.
1281333 . ** WSL filesystem copy** – The cloned working tree is copied into ` \\wsl$\<distro>\<path> ` using ` robocopy ` .
129- 4 . ** Cleanup** – The temporary Windows directory is automatically deleted when the process finishes.
134+ 4 . ** Cleanup** – The temporary Windows directory is automatically removed when the process finishes.
130135
131136> [ !IMPORTANT]
132- > By default, the ` .git ` directory is ** excluded** during the copy, so the destination folder will ** not be a Git repository** .
137+ > By default, the ` .git ` folder is ** excluded** during the copy, so the destination will ** not** be a Git repository.
133138> Use the ` -k ` / ` --keep-git ` flag to preserve the full Git history inside WSL.
139+
140+ ---
141+
142+ ## Contributing
143+
144+ Contributions, issues, and feature requests are welcome!
145+ Feel free to check the [ issues page] ( https://github.com/0xA672/wpush/issues ) .
146+
147+ ## License
148+
149+ Licensed under either of
150+ - Apache License, Version 2.0 ([ LICENSE-APACHE] ( LICENSE-APACHE ) or http://www.apache.org/licenses/LICENSE-2.0 )
151+ - MIT license ([ LICENSE-MIT] ( LICENSE-MIT ) or http://opensource.org/licenses/MIT )
152+
153+ at your option.
0 commit comments