Skip to content

Instantly share code, notes, and snippets.

@afriza
Last active March 13, 2024 15:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afriza/6353c5098e9471a0b6819d2a69a319f6 to your computer and use it in GitHub Desktop.
Save afriza/6353c5098e9471a0b6819d2a69a319f6 to your computer and use it in GitHub Desktop.
Copies rsync binaries and its dependencies from MSYS2 to Git for Windows
#! /bin/sh -x
# The reason to copy rsync binaries into Git for Windows is because
# VS Code has built in support for Git Bash shell in its Terminal.
# steps:
# 1. install Git for Windows from https://gitforwindows.org/
# 2. install MSYS2 from https://www.msys2.org/
# 3. Run as administrator: MSYS2 MSYS
# 4. execute the commands below in MSYS2 MSYS from step 3
# pacman options:
# -S to synchronize package/group with remote repository
# -Ql to query list of files in packages
pacman -S rsync
# notes & references:
# 1. check rsync dependencies from https://packages.msys2.org/package/rsync
# 2. from MSYS2, get the file list of rsync and its dependencies
# $ pacman -Ql rsync libxxhash libzstd
# 3. rsync the binaries found from step (2) to Git for Windows
pacman -Ql rsync libxxhash libzstd
# rsync options:
# -r for recursive, -z for zipped (compressed)
# -v for verbose, -p to preserve permission
# -t to preserve modification time
# -P alias for --partial --progress
# -L transform symlink into referent
rsync -rzvptPL /usr/bin/rsync* /c/Program\ Files/Git/usr/bin/
rsync -rzvptPL /usr/lib/rsync /c/Program\ Files/Git/usr/lib/
rsync -rzvptPL /usr/bin/*zstd* /c/Program\ Files/Git/usr/bin/
rsync -rzvptPL /usr/bin/*xxhash* /c/Program\ Files/Git/usr/bin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment