There are a few simple truths that remain consistent despite the pace at which technology advances in the web development industry.
One of which is version control.
In this course I would like to take you through how to properly navigate, Git a system of version control for every aspect of your WordPress site including themes, plugins the database and uploads.
We will also dive into the command line moving away from graphical user interfaces, so to leverage the power of git and bash scripting.
In this course we will be covering how to:
Create a Free Account on Github
Install Git on a machine
Setup Version control on a WordPress site locally
Some basic bash scripting for git and WordPress
Properly link a local git repository to Github
The logistics of pushing and pulling to Github using nothing but the command line
Write a portable bash script that can automatically download and install plugins as well as import and export a WordPress database
How to link a WordPress site to a Content Delivery Network for free, to simplify upload management and speed up your site dramatically
All while within the paradigm of using Github effectively in a collaborative environment
I have no doubt that if you are a WordPress developer and you are not currently using version control everyday that this course will be a massive additional bonus to your skill-set.
Introduction to Git
An Introduction to the course
An introduction and brief look at the tools suggested for this course. This includes:
- Sublime Text
How to install git for your machine as well as a setup and brief introduction to GitHub. We also take a look at Gists
A look into how to create a repository, log issues, use the project dashboard and add collaborators among other minor Github settings.
How to clone the `_s` theme from automatic to our local machine and begin making changes to it in the context of version control. We also cover some bash navigation and file manipulation from the terminal.
Look at how to use the following commands in a WordPress theme example:
- git status
- git add
- git commit
- git log
A graphical representation of how branches in git work as well as a discussion of best practices in a collaborative environment.
A practical example of how branches in git work using the command line interface as well as how to push changes to Github using https
How to create a public and private ssh key that will later be added to Github for authentication.
How to creating additional ssh profiles on a single machine using a ssh config file.
A look at how to switch Github profiles on your machine.
An introduction to the command line text editor `vim`.
How to find the contents of our public ssh key and add it to Github for ssh authentication.
How to create a Pull Request from a forked a repository as well as how it is merged.
Merge conflicts are something that need to be dealt with all the time in version control. Here we discuss how they are created and how to deal with them appropriately.
How to install and make use of the Node Package Manager, Grunt and Sass in the context of a WordPress theme and Git.
What a gitignore file is, as well as how to use it in the context of dependency management in a WordPress site.
WordPress plugins in Git
Plugins, Uploads and the WordPress Database are areas within a WordPress site that are difficult to put into version control (git). We discuss how to tackle these issues in upcoming sections.
Discuss three options of how Git for WordPress plugins is possible, as well as making the decision about which way is the best.
How leverage the power of bash scripting to create a script that automates tasks that would otherwise be tedious and time consuming to do manually.
How to loop through files in a bash scripting using a for loop as well as how to unzip them.
Discussion around the best way to manage 3rd party plugins.
How to read a text file that will ultimately serve as a list of plugins to be downloaded and installed automatically.
How to find the zip file online for a WordPress plugin as well as how to automate its download and unzipping it to the correct folder using a bash script.
How to setup our environment to cater for premium and custom plugins where the .zip files are not readily available for public download.
How to download a plugin from a private Github repository securely using the Github API and a secure token.
How to use `git archive` to achieve the same result as a secure call made to our Github repository for the BitBucket platform.
A look at how to use a more general format called JSON to store and categorize our plugins.
We also take a look at some command line tools that will help improve our script which include:
Construct a regular expression based script that robustly handles the downloading of WordPress plugins.
A continuation of creating our regular expression as well as copying and modifying it for our premium plugins function.
How to install plugins from our scripting using WordPress's built in command line tool.
WordPress Database version control
Discussion around if a WordPress database should be used and how to go about doing it.
How to setup the wp-migrate-db plugin for WordPress Database Exporting, as well as the pros and cons of the tool
How to use mySQL to export a WordPress Database, as well as the pros and cons of doing so.
How to add this to a bash script to automate database exporting.
How to write a universal find and replace script that uses sed and command line input to find and replace anything in our database.
How to run a command in the WordPress command line interface that will automatically handle database exporting for us.
A brief discussion on how to import a Database to WordPress with nothing but a sql zip file.
Auto deployment for WordPress with Version Control
A discussion around the pros and cons of the following auto deployment services.
Dealing with Uploads in Version Control
What a Content Delivery Network is as well as how we can use it for our images and files on WordPress site to cater for speed and Version Control.
The steps required in order to host your images on amazon including:
- Creating an s3 bucket
- Installing the Free plugins for s3 offload
- Creating Authentication Keys for s3 to connect to our WordPress site
Some Inspiration moving forward