Is there any good way to use SVN for uploads directory?

We just got our servers set up with SVN which works great. WordPress upgrades and plugin installations are managed manually, which all goes through SVN as well, but I can’t work out a good way to version control upload directories.

The best solution I can think of is to periodically go into the folders, look through the images to make sure they are legitimate (no self-unpacking shell scripts, etc) and commit them… either that or svn:ignore the entire folder.

Read More

Is there a better way to do this? All the discussion I can find on Google has to do with using SVN for WordPress installs, not dynamically managed assets.

Related posts

Leave a Reply

1 comment

  1. You could hook into the action add_attachment and perform an SVN commit.

    add_action( 'add_attachment', 'svn_commit_attachments' );
    
    function svn_commit_attachments( $attachment_ID )
    {
        // collect data about the attachment, for example its path, the user and so on.
         shell_exec ( '$ svn commit -m "$user added file $filename."' )
    }