Clone repositories on Windows, push to WSL.
Zero-config bridge between two worlds.
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.
Manually copying and converting paths is tedious—wpush automates it in one command.
Download wpush.exe from the Releases page and place it in a directory that is on your PATH.
# From crates.io
cargo install wpush-git
# From source
git clone https://github.com/0xA672/wpush.git
cd wpush
cargo install --path .Copy and paste the entire script into a PowerShell window. Administrator rights are not required unless you choose C:\Windows as the installation directory.
$url = "https://github.com/0xA672/wpush/releases/latest/download/wpush.exe"
$tempFile = "$env:TEMP\wpush.exe"
Invoke-WebRequest -Uri $url -OutFile $tempFile
Unblock-File -Path $tempFile
$destDir = "$env:USERPROFILE\.cargo\bin"
if (-not (Test-Path $destDir)) {
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
Write-Host "Created directory: $destDir" -ForegroundColor Cyan
}
Move-Item -Path $tempFile -Destination "$destDir\wpush.exe" -Force
$paths = $env:PATH -split ';'
if ($paths -notcontains $destDir) {
Write-Warning " $destDir is NOT in your system PATH."
Write-Host " To add it manually, run this command in an elevated PowerShell:" -ForegroundColor Yellow
Write-Host " [Environment]::SetEnvironmentVariable('PATH', `$env:PATH + ';$destDir', 'User')" -ForegroundColor Gray
Write-Host " Or add '$destDir' via System Properties -> Environment Variables."
} else {
Write-Host " $destDir is already in your PATH." -ForegroundColor Green
}
Write-Host " wpush installed to $destDir\wpush.exe" -ForegroundColor Green
Write-Host ""
Write-Host " IMPORTANT: Close and reopen your terminal, or refresh environment variables." -ForegroundColor Yellow
Write-Host " (If you use Chocolatey, you can run 'refreshenv')"
Write-Host "After that, try running: wpush --help"wpush [OPTIONS] <REPO_URL> <DEST_PATH>| Option | Description |
|---|---|
-d, --distro <DISTRO> |
WSL distribution name (default: Ubuntu) |
-b, --branch <BRANCH> |
Git branch to clone |
-u, --user <USER> |
WSL username (auto‑detected via wsl whoami if omitted) |
-k, --keep-git |
Preserve the .git directory (keeps full Git history) |
-n, --dry-run |
Preview actions without actually cloning or copying |
-h, --help |
Show help message |
-V, --version |
Show version information |
wpush supports two kinds of destination paths inside WSL:
| Format | Expands to |
|---|---|
~/myproject |
/home/<username>/myproject |
~ |
/home/<username> |
/absolute/path |
Used as‑is (must exist or be creatable) |
The username is automatically detected by running wsl -d <distro> whoami unless you override it with --user.
# Clone into auto-detected user's home directory
wpush https://github.com/user/repo.git ~/repo
# Preview what would happen (dry run)
wpush https://github.com/user/repo.git ~/repo --dry-run
# Clone a specific branch
wpush https://github.com/user/repo.git ~/repo -b develop
# Clone into a different WSL distro with a specific user
wpush https://github.com/user/repo.git ~/repo --distro Debian --user root
# Use an absolute path inside WSL
wpush https://github.com/user/repo.git /home/cero/projects/repo
# Clone with full Git history preserved
wpush https://github.com/user/repo.git ~/repo --keep-git- Git clone – The repository is cloned into a temporary Windows directory, with transfer progress displayed in the terminal.
- Path resolution – The destination path is expanded:
~and~/...are converted to/home/<username>/...using the detected or specified WSL user.- Absolute paths are kept unchanged.
- WSL filesystem copy – The cloned working tree is copied into
\\wsl$\<distro>\<path>usingrobocopy. - Cleanup – The temporary Windows directory is automatically removed when the process finishes.
Important
By default, the .git folder is excluded during the copy, so the destination will not be a Git repository.
Use the -k / --keep-git flag to preserve the full Git history inside WSL.
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.