Getting Started with Subversion, Git, or similar Version Control System to keep a History of my Files? [closed]

I realize this may be a broad question on the surface, but I’m looking for specific examples of setups/workflows that people use to keep a version history of edited files on a WordPress site. For instance, when developing a site (and even after it’s live), I often make changes to CSS and PHP files, but I don’t have a great way of reverting to older versions of those files. For my purposes, making changes on a local development installation and then copying those changes over to the live site is often more trouble than I’d like. Any suggestions on how to get started using a versioning tool to track edits to files on a live site?


I am not sure how much you know about using version control, but I recently switched from SVN to Git and find that to be great!

Though it depends in you live site’s server has Git installed (or will let you). I have a Git setup on the live server also, running off a branch called something like production. Whenever I finish implementing/fixing something locally, I merge it into the production branch, then SSH into the live site’s server and pull in the changes. Beats dragging files over FTP when you never know if you are overwriting changes etc.

I would recommend putting some time in getting acquainted with Git (if you haven’t already), I find it much easier and less hassle than SVN when it comes to changing/adding loads of files (and unlike SVN it doesn’t put stupid .svn folders everywhere).

I am on a Mac, so sorry if none of these applies, but I use Coda as a code editor and installed Git through Ports (using Porticus).

If I were to set everything up anew, I would do:

  1. Install Coda

  2. Install Porticus (which will require you to install Ports, but there is information on that page)

  3. Once you have installed Porticus, open it open, search for “git-core” and Install that.

  4. Download and Install GitX 7-5

  5. There is a good guide on setting up a git repo here, but at it’s basic: 1. Open Terminal. 2. cd to where you want your site to reside. $: mkdir mysite && cd mysite 3. $: git init and thats it! If you add files to this folder then continue to the next step

  6. Once you have set up a GIT repository locally (above article) then if you open that directory in GitX you will be able to commit stuff etc etc.

Setting it all up on the server can be a bit tricky, I have a MediaTemple and a Dreamhost account which both have GIT out of the box. The link in step 5 tells you how to add a remote repo, so you don’t have to do that until you want to bring your live site into the equation. I would recommend getting everything working locally first (unlike SVN, GIT doesn’t require a remote repository, so you can do everything on your machine for the time being).

Leave a Comment