rsync exclude according to .gitignore & .hgignore & svn:ignore like –filter=:C

As mentioned by luksan, you can do this with the --filter switch to rsync. I achieved this with --filter=":- .gitignore" (there’s a space before “.gitignore”) which tells rsync to do a directory merge with .gitignore files and have them exclude per git’s rules. You may also want to add your global ignore file, if you have one. To make it easier to use, I created an alias to rsync which included the filter.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)