Take the 2-minute tour ×

How to rsync only svn controled files from directory where are files under version control and files not under version control. Only svn controled files needs to be rsynced.

Motivation was move only necessary file to production and keep back all the other files like in .svn folder. There is potential of security risk if those files are on public server.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

I would think about generating a list of files under SVN control (there must be an svn command for this) and then use this with the --files-from=FILE option of rsync (see man rsync).

share|improve this answer
+1. "svn list -R" will do the job –  Sirex Nov 25 '10 at 14:37
add comment

Not sure why you would be doing this. Would svn export do what you want? This can be used to setup a tree on which you use rsync.

For production or testing websites, I generally recommend updating from a version which has been exported and archived. The archive is promoted through the release cycle.

share|improve this answer
Yes, the thing stay between testing and production. This is due security reason, we filter in production all svn and not wanted files. Historicaly we get an attack via svn files on production. –  Vaclav Kohout Nov 26 '10 at 9:35
Thats why I generate an archive from testing and migrate that. If you can keep testing stable, you could use rsync instead. You don't need svn in production for that. Where possible production files are not writeable by the userid used by the web server. –  BillThor Nov 27 '10 at 23:55
add comment

Your Answer


