One of the thornier problems in our workflow is knowing when assets are delivered from the designer and keeping them in sync with our application as they change. We used to use e-mail, Skype or sticky notes. The trouble is that the designer’s file naming and directory structure were never quite the same as the application’s
/public/images directory, so direct comparisons were impossible and we ended with a lot bookkeeping to make sure that we didn’t lose any changes. Our solution is to clone the project’s git repository into a folder inside a shared Dropbox folder.
Dropbox is cheap, if not free, available on all platforms, and synchronizes easily across most network connections. git is, well, awesome version control. We already had a Dropbox account set up for the project, and all team members had accepted invitations to join the share. We then made a
git clone of our application source code in the Dropbox folder;
cd ~/Dropbox/MyProject git clone https://github.com/myproject/myapp git-repository
We took a minute or 2 to show the designer how to find the
images directory, and our basic rationale behind naming and directory structure. That became her “new” assets folder. We did not show the designer how to use git, nor do we need to. As far as she is concerned, it is just another folder.
/public/images is even a familiar place for designers.
Here’s where the fun starts: We add the Dropbox/git-repository as a
remote to our main project repository.
cd ~/myapp git remote add dropbox file:///Users/me/Dropbox/MyProject/git-repository
Now, as far as our main project is concerned, the Dropbox folder is another remote, just like github.
During our daily workflow, whenever we need a new asset, or to look for a changed one, we
cd over to the Dropbox folder with the git repository, change into the
/public/images directory and look for what we need. We then use
git add to stage and commit only those assets that we need. Back in our main project, we then
git pull dropbox master
from the Dropbox remote and voila! New images! Later, if the designer makes changes, we can simply run
git status to see what’s changed, re-run git add, commit and pull. The only really gotcha is training our fingers not to type
git commit -am '...'
We have found this to be a very fast, lightweight, way of integrating new assets into the project and keeping track of old ones. The designer is no longer worried about getting out of sync with our project, nor are we worried about missing design changes. As a bonus, there’s a history in the git logs, so we can review changes and even revert if necessary. All this without the designer ever learning a single git command, nor us worrying about our project directory getting accidentally clobbered.
[This is actually a very old trick that I've been using since the late 90's, but back then it was using CVS and NFS mounted shares!]
There are other benefits, too. Sometimes we’ll make minor fixes to the images delivered to us. By adding a remote to the Dropbox git repos, we can pull from our application master and then the designer gets our fixes.
cd ~/Dropbox/git-repository git remote add myapp file:///Users/me/my app
Remember, it’s just a git repos! You can alway revert or reset to previous versions. In the most terrible worst case, you delete the whole Dropbox directory and start “over,” that is, at the HEAD of the repository master on github (or whereever).