• Can I keep the core code of my blog versioned with the WordPress SVN repository while keeping the custom code like wp-content and wp-config.php versioned in my own repository?

    I’d like updates to be checked into my repository, while running “svn up” would pull down the latest version from wordpress.org.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’d also like to know how to do this. I don’t really have any ideas as I’m new to both WordPress and subversion. Would it involve creating some sort of branch in your own repository?

    I’ve found a solution. It uses externals definitions, the same way plug-ins are handled if you install WordPress via Subversion. This allows any number of sub-directories in your local repository to be associated with different remote repositories.

    First, import your custom folder (whether it be a theme directory or whatever) into your own remote repository. Remove this directory from your local WordPress directory structure.

    Now you need to declare that this same directory (now deleted but soon to be checked out) is to be managed externally. Change into into its parent directory and run:
    svn propedit svn:externals .
    An editor window should open (this assumes that you’ve set some kind of EDITOR environment variable in your shell).

    Externals definitions are defined as follows:
    <sub directory name> <URI of external repository>
    Save and close.

    Now try running svn up. The custom sub-directory and its original contents should be recreated.

    It took a lot of fiddling around for me to get it working smoothly, just make sure you backup any important custom files first before trying. One thing I’ve noticed is that you need to be inside your sub-directory when committing changes for it. If you try svn ci in any directory above it then it will complain that you don’t have permission to make those changes to the remote WordPress repository (well it did for me but I’ve checked out a stable tagged version).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress Subversion (SVN) best practices’ is closed to new replies.