background preloader

Wordpress and git

Facebook Twitter

Modern WordPress Development for 2012. When I was 17 (which would put us around 2001), I did a one-year internship in a web agency. This was the era of full-flash sites, splash screens, and table-based layouts. It’s hard to convey just how different things were back then. There were no javascript frameworks, the Mac OS browser of choice was Internet Explorer (I know, hard to believe), and WordPress didn’t exist. The mere idea of Content Management Systems was still so new that a lot of agencies still developed their own system in-house, or else didn’t bother at all.

This is how I ended up building a hundred-page product catalog website consisting entirely of static html pages. Anyway, my point with all this is that it was pretty cool when WordPress came out a couple years later, in 2003. It’s been nearly 10 years, and we’re still using our trusty old WordPress… But just because we’re using the same software, doesn’t mean our methods can’t evolve.

Boilerplate Theme My starting point was the Boilerplate theme. Git SASS/Compass. Version Controlling WordPress. By Roy Barber, 27th January 2013 A lot of friends of the web asked how i usually work with Git + Wordpress, so i wrote this to show the structure and steps I take to setup Wordpress locally, version control and then deploy to a live server with Git.

Avoiding the need for 'Cowboy Coding' and a fully backed up version of your website. This is what we are aiming for: I'm presuming you already know how to use Git, if not follow this guide and you should be upto speed in no time. I use MAMP Pro to manage all my local versions of sites, if you use something different then the below might be setup slightly different but still with the same aim. First i locate my local htdocs folder and create a new folder, naming it appropriately. Why? Now into MAMP Pro to setup the local version, creating a host and pointing it to the htdocs folder within my future repository. Next download and install wordpress like you usually would, ensuring you place the files in the htdocs folder. Lets get it into git! How to deploy WordPress themes with Git | Culttt. One of the legacy problems with WordPress is it does not offer an easy out of the box solution for using Git.

This means that it is often the case that theme management is handled through FTP. Using Git for deployment is far superior than FTP in just about every way. In this post I will show you why you should only ever deploy with Git, and how easy it is to set it up. Why you should use Git? I’ve already covered why you should use Git in the past, so I will keep this to a brief summary.

Git is a version control system that sits discretely in the background of your project and monitors any changes you make. Git is also invaluable when you are working as part of a team of developers or when you are working on a project that has many concurrent development features or versions. One of the big advantages of using Git is when it comes to deployment. Git allows you to manage deployment from the command line. So hopefully you can see the many advantages of Git when it comes to deployment. 1. 2. Keeping WordPress Under Version Control with Git | Steve Grunwell. Update 9/26/12: Based on some excellent points made by Scott in the comments, I’ve updated the default .gitignore file Over the last year or so I’ve been deploying my sites and applications almost exclusively through Git. It took a while to get used to, but pushing all of my code through git has forced me to think through my code before committing (lest I get git blame‘d), kept me concentrated on the task at hand, and has made collaborating with other developers so much easier.

There are a number of different ways developers like to keep WordPress sites in Git. Some people commit everything while others may only track the theme(s), excluding core, plugins, uploads, etc. My preferred way of tracking/deploying WordPress sites through Git requires a little configuration; this article outlines my personal WordPress-Git workflow. WTH is Git?! Using a system like Git, a development team can easily track changes in projects. Additional resources Using Git with WordPress What’s your workflow like? Git Your WordPress On | Gray Ghost Visuals Press. The following screencast is a super special demo for the 2013 Buffalo WordCamp attendees on using WordPress, Git and Post Receive Hooks. We also make sure to showcase how these same steps are achieved using another service called Bitbucket.

You may notice in the demo a few commands I alias such as “g” or “gc.” It’s important to remember when you see these commands that they’re the same as git which I alias through “g” and git commit -m which I alias using the two characters “gc.” The Posthook <? If you’re new or a veteran to Github I suggest starring a repo I’ve created that allows for you and I to interact on Github and practice “All things Git.” Slides from my talk can be found at and also include some various links and suggested readings I highly encourage all users of WordPress and Git to checkout.