Using svn/git to Manage Landing Pages

Posted by Methylated on April 30, 2009

Version Control like Subversion and git are tools used primarily by programmers to keep track of code, and to collaborate changes when working in a group. Each person in the group edits/adds code and then “checks it in” to the repository. Other people in the group can check in their changes, and fetch changes that have been checked in to the repository, meaning that everyone in the group stays in sync without having to zip up and email or FTP individual code changes between each other.

This tools are invaluable for programmers, but they can be used by anyone. You can use them to mange static sites … which is basically what your landing pages are.

Why Use Version Control Systems for Landing Pages?

You can work on multiple computers and devices, and your landing page will be in sync on each device.

You can edit your remote/live landing page from any computer, without having to FTP or SSH to your server.

This means you can make changes fast, almost instantanously.

Your landing pages and code are highly organized. These tools keep a log of your changes, so you can check the timestamp and see exactly what change on your landing page had what effect on your CTR/conversions.

Reliability. Using these tools, you’re automatically backing up every change you’re making to the LP. This also means that should you want to switch servers, or if your server goes down, you can quickly just sync your local landing page onto the new server and be back up and running in minutes.

You can sync landing pages between users. Great if you work in a group or you hire people to make edits for you.

What Are The Cons?

The biggest con is the learning curve. These tools can be a pain to learn because of confusing terminology and concepts, but deep down they are basic applications that simply sync changes between different machines. The difference is that they are meant to sync on a very frequent basis and are optimized and come with many features for handling text/code changes between multiple users, and between “development” (LP on your local computer) and “production” (your remote, live LP) machines.

About svn/git

Subversion, also known as svn is a popular and easy to use version control system. Git is a newer, distributed version control system that was created by Linus Trovalds to manage the Linux Kernel source tree. At its heart, git is very simple, but it can be extremely confusing to learn if you’re coming from an svn background. They both might seem the same at times, but they work differently. The main difference is that subversion has a central repository where all the code gets checked into. Git is distributed, meaning each user has their own repository, and can sync with any other user. I won’t go into detail because it’s not important for managing your LPs.

Example of How They Are Used

Here’s a direct example of how I use git to manage my LPs. I look at my landing page and decide that I’d like to change the ad copy, perhaps revise it and make it shorter. NORMALLY, I would login to my server using FTP and make the changes to the index.html (or whatever) file. Or I may change the file on my own PC and then login to the server and upload it. But here’s how I would do it using git:

I open index.html on my PC, and revise the ad copy.
I then check in my changes using 1 command, on my PC.
The changes are sent over to the remote server, and merged with the landing page. That’s it.

To check in changes, I just use this command:

git commit -a -m "revised ad copy, removed word 'free', highlighted some text in yellow"

This creates an anchor in my code that has the message above. This means that in my log files, I will see “July 1st 2009, revised ad copy, re…” and I can choose to undo this change anytime in the future.

I then “push” the changes to the server using

git push

That’s it on my part. Done.

What happens behind the scenes is, git connects to the repository on my web server and sends the changes over. The changes are examined and merged with the landing page on the web server and then the main live landing page is updated to reflect the changes. I literally can refresh the page as soon as I hit “git push” and can see the changes have taken place on the landing page.

svn is used the same way except I only need to do:

svn commit -m "revised ad copy, removed word ...."

This commits and pushes the changes automatically.

If you aren’t into typing in commands, there are git and svn interfaces for Windows.

I’ll go into setting these up for your landing page later this week. For now, see these: