WordPress.org

Ready to get started?Download WordPress

Forums

WordPress + Subversion (SVN) best practices (3 posts)

  1. Richard K Miller
    Member
    Posted 7 years ago #

    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.

  2. joel01
    Member
    Posted 7 years ago #

    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?

  3. joel01
    Member
    Posted 7 years ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Topic