Tel: 07737089487
What's this all about? As a freelance web designer/front end developer I spend a lot of time working on projects on my own. But then what happens when you need to work as part of a larger team and you need to work on the same files sometimes at the same time. This is where version control comes in really handy. As a lone freelancer it can be difficult to get started with version control, several attempts with SVN and GIT I never managed to get over the tipping point where I could easily integrate it in to my day to day process. It’s hard enough to grasp some of the concepts but when the main point of using version control is to collaborate with other people (possibly the main point is tracking file changes, but for me at the moment it's about collaborating on projects), getting it going on your own can be tough.
I hit a couple snags along the way so I want to document them for myself and for anyone else that gets to that point where they have followed the instructions and WHAM! out of the blue you hit a brick wall and no explanation about how to get over it. So hopefully this article might just give you that leg up that you need.
So in summary, I’ve set about to learn GIT and in the process create a setup by which I can start using it on my website building projects.
What this isn’t
An article that will help you to install and start to use GIT. There are far better articles out there that I can point you to that will help you with that.
Caveats:
I’m using a Mac so everything I talk about will be Mac centric.
During this process I’ve realised that I’d often rant and rave because I’d be following all the steps A-Z outlined in the book or article and I’d get to step G and hit a problem. Previously I’d blame it on the article I was reading because it was missing that vital bit of information that I needed, and I’d invariably spend the next several hours scouring Google for the answer. The reality is that everyone’s journey is slightly different dependant on many factors, so unfortunately this article may lack that vital bit of information. If you do find anything that is missing please comment or get in touch and I’ll make any updates that are required.
So you should have installed GIT and played around with it a little bit. You’ve either tested or have an idea of the following 6 commands:
status, add, commit, pull, merge, push
If not then read over this again: Git: A Designer’s Primer - http://designfestival.com/git-a-designers-primer
My setup
So here’s my setup and what I wanted to do with GIT.
I tried to install it on one of my servers but it didn’t work so for now I’m resorting to using GIT HUB as a remote repository so I can work across 2 computers. It’s easy enough to get started with GIT HUB and once you have an account you can create repositories fairly easily and then start using a multi computer set up.
Ok, so I wanted to test out a couple of the features of GIT. I thought it would be pretty cool to use it so I could work on 2 computers to update a website, keeping the files synced on both systems. Partly because I wanted to duplicate the scenario of 2 or more people working together on a project and partly because I do occasionally have a situation where having a synced version of a project would be useful.
Here’s what I did:

Stage 1 - Setup GIT
I setup GIT on both the iMac and then the Mac Book.
Stage 2 - Start using GIT
I had a Drupal web project setup on the iMac using XAMMP server. I added and committed the files to GIT. I setup .gitignore and setup the config file.
Stage 3 - GIT HUB
I already had an account with GIT HUB, from previously failed attempts to use GIT, so it was pretty easy to set up a repository. Following the online instructions I was able to connect my computer to GIT HUB and push the files to the repository.
Stage 4 - Setup the 2nd computer
GIT has already been setup so it was just a case of cloning the repository.
You clone a repository with git clone [url]:
# git clone [url]
If you don’t include a directory name at the end of that command it uses the directory name in GIT HUB by default.
Stage 5 - Configure the website
I needed to connect the database which I kept in Dropbox, there’s probably some clever way to automate this bit too, but I’ll have to find that our some other time.
Sweet it all works
That was the initial aim complete. I can now change files, add, commit and push them back to the online repository. Then fetch, and merge them into which ever computer I’m working on. As long as I remember to export the latest version of the database and add it to Dropbox.
My next post will be the missing link, outputting your files on your web server.
Leave a comment...