Rsync and recursion protection with .svn folders

Richard Lee richard at
Thu Dec 18 10:07:44 GMT 2008

Cheers mate thanks,

That was EXACTLY what I was looking for. I swear to god I scoured the
internet and rsync man pages, but I did not see the little 'p' modifier.

Thanks again Matt!

Matt McCutchen-7 wrote:
> On Wed, 2008-12-17 at 09:02 -0800, Richard Lee wrote:
>> src(local copy) --> dst(svn working copy)
>> I want to sync changes over from src to dst, leaving the [.svn] folders
>> intact
>> on the dst, as long as the folder containg the [.svn] folder still exists
>> in
>> the source. i.e. If a folder is deleted from src I would like it to be
>> deleted from dst, this implies that its .svn folder is deleted in dst.
>> (Additions and changes are handled automatically by svn.)
>> So what I did is a rsync fom src to dst with --exclude=".svn" --delete
>> --force. However if I delete a folder say myfol from source which also
>> exists in dst, I says that it cannot delete it. Obviously this is due to
>> the
>> fact that rsync recurses and finds and protects the .svn in myfol.
> What you need is the "p" modifier to a protect rule, which makes it not
> protect a destination file whose parent no longer exists on the source.
> Use --filter='Pp .svn'.  Copying to an svn working tree was actually a
> major use case motivating the addition of the "p" modifier:
> -- 
> Matt
> -- 
> Please use reply-all for most replies to avoid omitting the mailing list.
> To unsubscribe or change options:
> Before posting, read:

View this message in context:
Sent from the Samba - rsync mailing list archive at

More information about the rsync mailing list