Version Control
All web developers should be using version control software to maintain their local copies of software. For example, you are working on a brochure style website, and the client asks for a small change to the layout. They they don’t quite like that change and ask for a different version of it. Finally the next day they ask to go back to the version of the site from 2 days ago. Overall, you may not remember what that means, but if you had your site under version control software it would simple be a means to fix the site.
Or take the times in which you reformat your computer, and its been 2 years since you last looked at a project. But since you have deleted out the files off your computer you now need to reinstall them from the live server, and in so doing you most likely don’t have all the original source files or your notes. If you had taken the time to add the files into version control software you could quickly just pull the files from a central repository and get to work.
All of this sounds good and I think that most people would agree we need to keep our software under some type of version control software but it has to be quick and easy.
I have a github account, and use git, but at times I would prefer to use mercurial, or another solution. In my opinion any of these distributed version control software solutions are fine. However, I don’t want to make all my projects public, nor do I want to pay for every single project to be hosted on github (or other service). Some projects that I want to be released to the public are a great place, and other projects that I am working with many developers on, can be in a private github account. But for me to pay $22 a month to host 20 private accounts is a bit extreme.
Use DropBox
Overall I have been using dropbox for around a year. I often use it to share between my computers files such as my 1password DB Or keep my todo list in sync. However for the last month or so I decided to expand my dropbox usage, to maintain all my current web projects.
- 1 I assume that at the point I go to deploy an application my computer will break.
- I would like to do version tracking with projects
- I need to have all my projects available to me on any computer, as well as with those who work with me.
- In 6 months I want to be able to quickly grab my project, source files and notes on a website to get upto speed quickly.
To help keep all of that and more in sync I have been using drop box and recommend that you look at doing the same download link. The dropbox crew has made setup and sharing files dead simple. In many ways dropbox is what I always hoped my .mac idisk to be.
Setup your todo’s
I use textmate all day long. I grew tired of having 20 applications open on my computer, so I decided a few months ago to abandon omnifocus (at least for now). Instead I found a textmate plugin called text-bundle. Basically all this bundle does is create a heading with a : - and either a dash for items to do, or checkmark for tasks completed.
Usually I have set for any given day 5-10 tasks which need to be done, then as I complete them I check them off the list. Some of them need notes, so I enter the date (isoD (tab)) and write a note. I also have 2 subfolders one called archive and the other projects.
On my todo list it can hold about a months worth of tasks, and billing notes for each month so once that the month is completed I move the old todo list for the month into the archive, and I can get to it if I need it or totally ignore it.
For my active projects those are keep in a Projects folder with the name of the client and project e.g. WidgetIncHomePage.todo. When I’m talking over the project I use the task bundle to make my notes - usually a section at top has the list of todo’s, and then at the bottom has notes from our conversations. As I complete the action points I check them off the list, and make any additional notes. Finally once the client is satisfied, I archive the task, add the billing to my toBill document, and move on.
Between textmate and dropbox - I have managed the project, with no extra software running on my computer except my text editor.
Second I have a central location of all my notes, and I can access them anywhere with no problems. I don’t have to worry about backing them up either. So at the end of the month I have 1 place to look up billing, 1 place to manage my client notes, 1 place to keep my todo list straight.

Git repository
I also need a repository to keep my files backed up. So what I have done is create a folder called GitRepo in my dropbox folder and I backup each project to my gitRepo folder. Basically I cd into my folder I’m working on, and with the repository ready I create a clone of it to /Users/tspore(my user folder)/Dropbox/GitRepo/Allplaces.git(the name of my site). Next I create a remote connection - git remote add dropbox <- All of my projects have the remote now of dropbox. Once I’m ready to backup I just git push dropbox and the projects are backed up to my dropbox.
$ git clone –bare . /Users/tspore/Dropbox/GitRepo/Allplaces.git
$ git remote add dropbox /Users/tspore/Dropbox/GitRepo/Allplaces.git
$ git push dropbox
If you don’t add in the –bare, you will find a lot of issues with adding and pulling files in the future. Also I can now just share a repository, and they can quickly make changes. Easy Peasy.
The Story so far
So now I have all my projects under version control in this case using Git. I have all my project notes in a central location, in my todo folder. And also I have all my files backed up. I can access all of this anywhere on any computer. I am 99% done.
If you want to pull your changes -
$ git pull dropbox master
Publishing a site using SSH
So 99% of the time I can just use ssh to talk to my servers (as in colocation or slicehost or something like that). But I personally don’t like ssh/sftp, I’m lazy, and find that method at times feels awkward. But like a super hero flying in comes GIT.
My basic LAMP server setup looks something like /var/www/site/ . In the sites folder apache is pointed to /var/www/site/public/ , and I have a space to put things like htpassword, config files, etc, 1 directory up, outside of public directory. So back to business -
ssh into you remote server
$ cd to /var/www/site/
$ mkdir website.git
$ cd website.git
(Now you have in /var/www/site/public & /var/www/site/website.git directories)
$ git init –bare
$ git config core.worktree /var/www/site/public
$ git config core.bare false
$ git config receive.denycurrentbranch ignore
$ cat > hooks/post-receive
#!/bin/sh
git checkout -f
$ chmod +x hooks/post-receive
back on your local machine
git remote add web ssh://lamp.server.com/var/www/site/website.git
git push web master
Basically now I can issue a git push web anytime to update my site. I love super git :D This basic info comes from this article.
Publishing a site using FTP
In my new minimalistic approach how do I publish to the web. I do often use Transmit It is a great FTP client. I also do use git with ssh to publish a lot of sites. But on some sites I only have ftp access. So I needed a way to publish without Transmit. I found a simple tool call git-ftp.
I saw this on github - However, the install instructions were for Linux, but it really doesn’t require much.
$ git clone git://github.com/resmo/git-ftp
$ chmod +x git-ftp/git-ftp
Now when you want to FTP a site to a server -
$ ~/git-ftp/git-ftp push -u example -p -v ftp.example.com
It will prompt you for your password (-p)
The results
Basically now I have version control, backups, centralized notes, simplified billing, and can publish all from my favorite text editor e.g. textmate. As well as I can publish my sites using either SSH, or ftp over git. All in all it isn’t only a time saver but a method to keep organized, and a minimalistic approach to web design.