diff --git a/README.markdown b/README.markdown index db3e459..bc58985 100644 --- a/README.markdown +++ b/README.markdown @@ -164,12 +164,99 @@ Or if you wanted to go straight to a subdirectory within `capistrano`: ```bash $ s cap $ s capistrano/ -# => bin/ lib/ test/ +# => bin/ lib/ test/ $ s capistrano/l $ s capistrano/lib/ # => cd ~/src/gems/capistrano/lib ``` +## Linking External Project Design Directories + +When you're creating logos or icons for a project that uses `git`, +have you ever wondered where you should store those `.psd` or `.xcf` files? +Do you commit all of your raw design files, or does it put you off that any changes to those files +will bloat your repository? + +Here were my goals when I set out to find a solution: + +* I wanted a design directory for each of my projects +* I didn't want the design directory to be checked in to the git repository +* The design directory needed to be synchronized across all of my machines + +The simplest way for me to synchronize files was via my Dropbox account. +However, if you work with a larger team, you could set up a shared design directory on one +of your servers and synchronize it with `rsync`. + + +### 1) Create and configure a root design directory + +I created my root design directory at `~/Dropbox/Design`. + +After you've created your root design directory, edit `~/.scmbrc` and set `root_design_dir` +to the directory you just created. +You can also configure the design directory that's created in each of your projects +(default: `design_assets`), as well as the subdirectories you would like to use. +The default base subdirectories are: Images, Backgrounds, Logos, Icons, Mockups, and Screenshots. + +After you have changed these settings, remember to run `source ~/.bashrc` or `source ~/.zshrc`. + + +### 2) Initialize design directories for your projects + +To set up the design directories and symlinks, go to a project's directory and run: + +```bash +design init +``` + +If your root directory is `~/Dropbox/Design`, directories will be created at +`~/Dropbox/Design/projects/my_project/Backgrounds`, `~/Dropbox/Design/projects/my_project/Icons`, etc. + +It will then symlink the project from your root design directory into your project's design directory, +so you end up with: + +* `my_project/design_assets` -> `~/Dropbox/Design/projects/my_project` + +It also adds this directory to `.git/info/exclude` so that git ignores it. + + +If you use the git repository index, +you can run the following batch command to set up these directories for all of your git repos at once: + +```bash +git_index --batch-cmd design init +``` + + +If you want to remove any empty design directories, run: + +```bash +design trim +``` + +And if you want to remove all of a project's design directories, even if they contain files: + +```bash +design rm +``` + + +### 3) Link existing design directories into your projects + +If you've set up your design directories on one machine, you'll want them +to be synchronized across all of your other development machines. + +Just run the following command on your other machines after you've configured the root design directory: + +```bash +design link +``` + +This uses your git index to figure out where to create the symlinks. +If you don't use the git index, the same outcome could be achieved by running 'design init' +for each of the projects. + + ## Anything else? @@ -222,3 +309,4 @@ for Mercurial, SVN, etc. ## Enjoy! +