How to use rsync on Git Bash

1. Install zstd

zstd(Zstandard) is a compression algorithm by facebook that we’ll be using from now on. First download a zstd release zip file from the below link.

cd ~/Downloads
mkdir zstd
mv ./zstd
cd zstd
echo "alias zstd=\"/c/Users/[USER_NAME]/Downloads/zstd/zstd.exe\"" >> ~/.bashrc
source ~/.bashrc
zstd -h result

2. Get rsync.exe

All the required files can be acquired from (will be used in step 3 as well)

mv ~/Downloads
mkdir rsync
mv rsync-3.2.3-1-x86_64.pkg.tar.zst ./rsync
cd ./rsync
zstd -d rsync-3.2.3-1-x86_64.pkg.tar.zst
tar -xvf rsync-3.2.3-1-x86_64.pkg.tar
mv ~/Downloads/rsync/usr/bin/rsync.exe C:\Program Files\Git\usr\binecho "alias rsync=\"/usr/bin/rsync.exe\"" >> ~/.bashrc
source ~/.bashrc

3. Acquiring the missing dll files

So, to normally execute rsync, we require two additional dll files, libzstd and libxxhash.

  1. libzstd
mv ~/Downloads
mkdir libzstd
mv libzstd-1.4.8-1-x86_64.pkg.tar.zst ./libzstd
zstd -d libzstd-1.4.8-1-x86_64.pkg.tar.zst
tar -xvf libzstd-1.4.8-1-x86_64.pkg.tar
mv ~/Downloads
mkdir libxxhash
mv libxxhash-0.8.0-1-x64_64.pkg.tar.zst ./libxxhash
cd ./libxxhash
zstd -d libxxhash-0.8.0-1-x64_64.pkg.tar.zst
tar -xvf libxxhash-0.8.0-1-x64_64.pkg.tar
mv ~/Downloads/libzstd/usr/bin/msys-zstd-1.dll C:\Program Files\Git\usr\bin
mv ~/Downloads/libxxhash/usr/bin/msys-xxhash-0.8.0.dll C:\Program Files\Git\usr\bin
rsync -h result



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Seunghyun Chae

Seunghyun Chae

Ph.D student @POSTECH. Majoring in Software Verification, specifically NN verification