Chapter 3. Source Control Management

My personal journey of how I came to source control management, also known as version control, is likely a familiar and tragic story to many.

Many of my attempts at controlling revisions to my code in my early years of learning web development went a little like this:

  1. Zip up a directory that contained all the code I wanted to save.
  2. Name the file something like backup10102012.zip.
  3. Fool myself into thinking that was all I needed if things went wrong.
  4. Back up that zip file to an external drive.

Just four steps. Rock solid, right?

You probably know how this story ends. At some point, I needed to revert back to a previously saved version of a site I was working on and my four-step zipping process failed me. Looking at it now, it seems obvious:

  • There were no notes as to what “version” of the zip file was different from the other, similar-looking zip files.
  • If I did have documentation, it was likely zipped up and I wouldn’t see it without unzipping the directory.
  • Incremental changes received less-than-useful names like backup10102012-a.zip and backup10102012-b.zip.
  • The ability to collaborate with others was virtually nonexistent.

Fortunately, there is a better way to manage code.

Like Wikipedia for Code

In case you haven’t been introduced, source control management software can be described as “Wikipedia for your code.” When you edit a page in Wikipedia, you and others can see the revisions, roll back to previous edits, make comments, and track the ...

Get Coding with Coda now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.