Converting WordPress to Web App: Adding Version Control

Part two of my Converting WordPress to Web App series, as we convert this site from a standard WP website to a cache-enabled, offline-first, performance-optimized, installable Web App, that takes advantage of Build and Deployment processes, and sits safely revisioned in a Version Control repo.

The steps that I plan to take are listed below; each will become a link as I complete and publish that part of the series.

  1. Series Intro
  2. Adding Version Control (this post)
  3. Adding a Build Process
  4. Adding a Deployment Process
  5. Adding Caching and Offline Support
  6. Adding “Add to home screen” functionality

And now, on to…

Adding Version Control

At the moment this website does not use a repo. And while using a repo for a WP site is not exactly a challenge, it is an important part of this process.

GitHub provides a really nice, easy-to-follow Getting your project on GitHub guide. Use the root directory of your local WordPress installation (this is the directory where the wp-admin and wp-includesdirectories, and the wp-config.php file can be found) as the repo to push to GitHub. We will be changing some things as we get into the next couple steps, but for now this will get us started.

Following through that GitHub guide, you should be able to make a trivial change-or-two to your files, commit, pull and push them, then log-in to GitHub and see your changes reflected. It’s a pretty cool feeling if you’ve never done it before, so play and have fun.

On a typical project, you will want to commit often, and push when you have something that is ready for the team, or is ready “to be saved”. I highly recommend getting to know Git better, digging into Branches, Rebasing, and more, to be able to take advantage of the real power of Git-based repos.

Status Thus Far

As I said above, this installment was not exactly a challenge, but any project worth the time to create, should be worth the time to secure in a repo. And when you are working on a team project, a repo is vital, allowing everyone to contribute (mostly) without fear of overwriting one-another’s work.

Next Up

Things will really start escalating in the next installment when I will be Adding a Build Process, so there are a few items you may want to have ready if you want to “play along at home”:

  1. Be familiar with the concepts of a Build Process / Task Runner. You don’t have to be an expert, but you might want to read-up on, and at least understand, the “What” and “Why“.
  2. Pick a Task Runner. I will be using Gulp, but you can also use Grunt, Broccoli, Node, or maybe even your text editor itself! As with the repo selection, you should be able to use whatever you choose.

Until then, happy Web Apping,
Atg

One Response to Converting WordPress to Web App: Adding Version Control

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.