I have three windows boxes that are connected to a linux box on my network in various ways (one's local to the network, one is a laptop and may or may not be local, and the other is my work desktop). I'm currently making use of git to syncronize most of my stuff between the boxes (using the Linux box as the server) and it works like a champ.

Now, however, I'd also like to add my MP3 collection (12 gigs) to be efficiently synchronized between boxes. I initially thought I could use git for this, but it looks like rsync would be a better choice since I don't really need all the historical stuff. Since all my existing management scripts run under git bash (instead of cygwin), I'd like to be able to use it from git bash (MINGW32 is what it says in the title bar of the window). Can I just download it in Cygwin and copy it over or is there a better way to approach it? The Linux box is running the latest version of Ubuntu Server edition - do I need to do anything to it to enable rsync to work correctly on it?

I realize I'm probably doing this in a slightly harder way than is needed, but I'm also kind of using this as an exercise in improving my commandline skills. Any suggestions?


I can use rsync from my cygwin shell, but not from msysgit. I tried copying rsync.exe from cygwin's bin folder over to msysgit's bin folder, but it still isn't finding it. Is there some other step I need to do to install it there? It's strange that I'm getting an error that it can't find the file, instead of giving me an error that one of the file's dependencies is missing.

As of now (9/7/2017) it is extremely easy to manually add rsync support to the Git for Windows environment without even having to resort to running the Git for Windows SDK.

I stumbled across this post and didn't think it could really be that easy given all the alternatives, but it really is. All you need to do is grab the rsync package from the MSYS2 Package repository and extract the rsync.exe file into C:\Program Files\Git\usr\bin. One and done. It works.

If you want to also use Pageant authentication with rsync over ssh, the ssh-pageant binary is already installed in Git for Windows and all you need to do is add a small bit to your ~/.bashrc or ~/.bash_profile file (see ssh-pageant usage section and Git for Windows wiki). I've modified it specifically for use with the Git for Windows environment and enhanced it with some detection for a missing socket file:

# ssh-pageant allows use of the PuTTY authentication agent (Pageant)
SSH_PAGEANT="$(command -v ssh-pageant)"
if [ -S "$SSH_AUTH_SOCK" ]; then
  PAGEANT_SOCK=$SSH_AUTH_SOCK
else
  PAGEANT_SOCK=${TEMP:-/tmp}/.ssh-pageant-$USERNAME
fi
if [ -x "$SSH_PAGEANT" ]; then
  eval $("$SSH_PAGEANT" -qra "$PAGEANT_SOCK")
fi
unset SSH_PAGEANT
unset PAGEANT_SOCK

I can't speak to how other utilities might or might not work by manually installing them this way, but rsync appears to work just fine. Hopefully that repo will stay and continue to be updated--I'd think so because it's hosted at the official MSYS2 site.

  • 1
    thank you sir, downloading and it works .. who would have known... – P.Scheit Nov 18 '17 at 7:46

I know the question isn't "Using rsync for MSYS", but I think mentioning this is relevant:

"MinGW Shell" (formerly best known as "MSYS (Basic System)") does indeed have rsync. I'm using that shell/system as often as possible since it's much smaller than Cygwin. (I'm probably the only one that cares about file sizes these days.)

"Git for Windows" / "Git Bash" could easily add rsync since it based on MinGW/MSYS and it has been mentioned on the mailing list earlier.

PS! If your MinGW Shell doesn't have rsync, just run "mingw-get install msys-rsync" to add it.

Updated 25th of March 2016:

Git for Windows now uses MSYS2. And MSYS2 uses "pacman", not "mingw-get", to install packages. Unfortunately, "Git for Windows" doesn't include pacman ... There are two options:

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

The last option is my favorite, but it's not streamlined yet so the first option is probably easier. Hopefully, it will be fixed.

PS! I haven't played much with MSYS2 / pacman, but it seems very promising.

  • sadly, in Git Bash: $ mingw-get bash: mingw-get: command not found – Hendy Irawan Mar 24 '16 at 17:06
  • Yes, it's a bit sad. Look at my updated answer above - still sad, but the situation has improved. – hansfn Mar 25 '16 at 8:40
  • I went for the second option and I ended up with a 2.17GB folder, but everything work like a charm. I installed rsync by using pacman -S rsync. In the past I used CygWin but I think MSYS2 is awesome, I don't have to run a gui to install extra packages. – Edenshaw Jun 21 '16 at 16:39
  • The bug report listed in this answer has since been closed as "unfixable" - however, I have created a pull request to have rsync included with Git for Windows. – Scott Stevens Feb 14 '17 at 12:54

I assume by git bash you really mean msysgit, aka "git for windows." The Start Menu option is git bash, which explains the name you used..

First, you are correct in dismissing git as an option here. One of the things git does not do well is handling binary files--and you'd end up with a huge, bloated repository. Additionally, since you won't be handling changes, using the overhead of git strikes me as overkill.

Secondly, it sounds like the question you're actually asking is, "Can I use rsync from msysgit/Windows?" The short answer is, not out of the box. msysgit is really just the Windows command line in terms of form and function. That being said, you have two options: download a third-party tool to enable rsync on your Windows machine (Stack Overflow: Rsync for Windows), or just use cygwin. Really, they have the same outcome--so its up to you to decide which ones work better.

  • I can use rsync from my cygwin shell, but not from msysgit. I tried copying rsync.exe from cygwin's bin folder over to msysgit's bin folder, but it still isn't finding it. Is there some other step I need to do to install it there? It's strange that I'm getting an error that it can't find the file, instead of giving me an error that one of the file's dependencies is missing. Thanks, Will – Will Gant Sep 13 '11 at 1:31
  • This simply isn't possible. cygwin sets up a GNU-based environment, including Linux-like libraries, configs, etc.. msysgit is the Windows command line, which supports Windows executables. What's likely happening is, its not even able to detect the file as executable. Simply put, cygwin and msysgit are not even remotely compatible. – Andrew M. Sep 13 '11 at 2:08
  • It is possibly but hacky. Copy cygiconv-2.dll, cygwin1.dll and rsync.exe from Cygwin to your msysgit path. Nothing else (especially not ssh.exe). The problem is usually an incompatibility between Git SSH and Cygwin/rsync SSH. Try to keep the same version. You'll still have issues with the /cygdrive/ but there I've no solution except a cd. – Wernight Jun 18 '12 at 23:47

rsync is a great for unidirectional sync. You can either run rsync under cygwin, or for Windows there is also Deltacopy

If you wanted to have bidirectional sync, then take a look at unison

  • unison is great, but you have to install it on server - like 90% of servers are rsync ready. And OP asked for rsync – P.Scheit Nov 18 '17 at 7:50
  • the OP asked about rsync, but the what the OP was trying to achieve was "to be efficiently synchronized between boxes", and unison is available in most repos... – shouldbeq931 Nov 19 '17 at 11:20

For what it's worth, I was having similar problems getting cwRsync to work in msysgit when dropped into the bin path, but after trying lots of different things eventually found that simply updating to the latest version (2.10.2) of Git for Windows fixed the issue.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.