[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

31 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.

  4. This worked perfectly — thank you! I used a more recent version of rsync, found here:

    http://www2.futureware.at/~nickoe/msys2-mirror/msys/x86_64/rsync-3.1.3-1-x86_64.pkg.tar.xz

    For some reason, my 7zip didn’t understand the .xy format, so I expanded it with

    tar -xJf /mnt/c/Users/me/Downloads/rsync-3.1.3-1-x86_64.pkg.tar.xz

    Moved the .exe into C:\Program Files\Git\usr\bin like you said and rsync is working great from within the Git bash shell (MinGW64).

  5. This has been bugging me for years! Finally with your tutorial it works perfectly.
    And as usual, after exhausting all the trivial-seeming but non-working solutions, the working solution seems trivial 😀

  6. Great work! A solution 3 years at service and still valid! That’s rare, man. Thanks you so much.
    Greeetings!

  7. I’m gone to say to my little brother, that he should also visit this website on regular basis to get updated from most recent information.|

  8. Doh, seriously! DOH!! I really should have though of this.
    Thank you so much for showing me how dumb I’ve been.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.