As I rely more and more for Git to deploy changes to web apps (see here and here), the thought of going back to FTP induces shutters (OK, that’s an overstatement). Now I’m working on a WordPress site with a purchased theme that requires some customization. I don’t see any reason to store the core WordPress files in a repository, or the plugins folder for that matter (unless I’m writing my own, and I’m not), so I only want to version control and deploy the theme I’m making customizations to.
Gitignore to the rescue.
I found this great .gitnore file on Github that is working perfectly: https://gist.github.com/jdbartlett/444295
I previously posted about using git to deploy to Ubuntu. However, that’s only relevant to me for my ”day job” where I can have some control over my server environment. For other work, I currently host a number of sites on Hostgator. I’ve fallen in love with the simplicity and power of deploying sites using Git (after the initial setup), so using Git in a shared hosting environment would be a huge win.
Luckily, I found a few resources out there on how to set this up, but in the end, the only real difference between my workflow for Ubuntu and hostgators turns out to be saving the Hosgator SSH port (2222) in a ~/.ssh/config file as described here.
- You must have SSH access on the domain you are working with. I believe it comes with your primary domain, and you have to pay $2(?) a month for SSH access per domain beyond that.
- It’s easier if you use the SSH public keys as described here.
- You can just create your bare Git repositories under /home/[username]/git if you want to set it up as I described in my previous post.
I just picked up a refurbished 2012 Macbook Air from the Apple online store to replace a 2007 Macbook Pro. I didn’t use the MBP much because it just couldn’t keep up, but I missed being able to work anywhere, including at home without having to sneak upstairs to the office.
Now that I have the MBA, those limitations are gone, but working on the same project on different computers can still be a challenge. However, compared to just a few years ago, creating the same web development environment across several computers can be accomplished with just a little effort.