[Windows Bash] Add Rsync to “Git Bash for Windows”

In last few post we mentioned using bash in Windows by install Git.
It comes with handy *nix tools like grep, find, wget, curl, vim, ssh… but something still missing is rsync
Because it do not mean to be collection of POSIX software for Windows. It is a wont-fix for them.

Git for Windows is based on MSYS2 (As of version Git-SCM 2.13.3)
Unfortunately it does not comes with pacman (Package manager) so there are not official way to install packages.

Furthermore, cwRsync and DeltaCopy does not work in bash environment.

According to this post in serverfault, there are two ways to do:

  1. Install the Git for Windows SDK (which includes pacman).
  2. Install Git inside MSYS2.

I tried both solution but they missed the explorer integration in Git-SCM version.

Well… they both based on MSYS2 and their executable should be compatible

After dig down how pacman on Windows works, I decided to download the package from pacman repository.

Extract it using 7-zip and drop rsync.exe to C:\Program Files\Git\usr\bin and profit!

Likewise, you can find more *nix tools from pacman repository and install it manually.

Update: Original mirror seems down, please download from original repository

9 Replies to “[Windows Bash] Add Rsync to “Git Bash for Windows””

  1. Rysnc was very effective on linux but there is nothing similar to it on windows. My friend told me about GS Richcopy 360. I then started using it, seriously man it helped me a lot and is as effective as rsync. Totally worth it!

  2. I have a partial success following this article to install rsync under Windows 10.

    At least I got some output from the rsync session.

    I run with this command:

    rsync -atv user@remote:/some/folder/ /c/users/someuser/somefolder/

    But I got lots of erros and at the end, no files were rsynced to local.

    Major errors:
    rsync: failed to set times on /c/users/someuser/somefolder/.: Permission deined (12)
    rsync: recv_generator: mkdir “/c/users/someuser/somefolder/FolderX failed: No such file or directory (2)
    *** Skipping any contents from this failed directory ***

    For each of remote folders.

    What should I do to trouble shoot?

    ps. The remote Linux is working fine when I do rsync from macOS or other Linux machines.

  3. Update:
    Now I fixed it by allowing rsync to make changes to folders via Windows Defender Security Center – “Allow an app through Controlled folder access” .

    Only after running rsync a few times I notice the prompt from Windows Defender.

Leave a Reply

Your email address will not be published.