Skip to content

Instantly share code, notes, and snippets.

@xavierskip
Created March 10, 2024 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xavierskip/20f4eaf545f86d42685d06d819efaafb to your computer and use it in GitHub Desktop.
Save xavierskip/20f4eaf545f86d42685d06d819efaafb to your computer and use it in GitHub Desktop.
The git hook pre-push script on Windows uses WSL to execute the rsync command for file synchronization.
#!/bin/bash
# https://stackoverflow.com/a/67658259/1265727
# solve:The source and destination cannot both be remote.
# rsync error: syntax or usage error (code 1) at main.c(1428) [Receiver=3.2.7]
export MSYS_NO_PATHCONV=1
wsl rsync -azhP raspi:/home/pi/www/ /mnt/z/backup/www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment