title: git deploy with submodules
body: <p>I've been looking into different ways of deploying sites using git, and found the following tutorial:</p>
  
  <p><a href="http://42pixels.com/blog/quick-and-dirty-git-deployment" rel="nofollow noreferrer">http://42pixels.com/blog/quick-and-dirty-git-deployment</a></p>
  
  <p>I like the ideas presented in this tutorial, and would be keen on using it for my sites, only it doesn't seem to support submodules.</p>
  
  <p>Is there anyway that this can be changed so that submodules are also pulled in and updated as required?</p>
  
  <p>Thank you.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I've been working on this problem for the last couple of hours, and I seem to be making progress, but I still can't get it working.</p>
  
  <p>I've switched to this tutorial: <a href="http://toroid.org/ams/git-website-howto" rel="nofollow noreferrer">http://toroid.org/ams/git-website-howto</a> (which is mostly the same, just a few slight changes), and after following some advice found here: <a href="https://stackoverflow.com/a/6636509/1049688">https://stackoverflow.com/a/6636509/1049688</a> I've ended up with a post-receive file that looks like this:</p>
  
  <pre><code>#!/bin/sh
  
  export GIT_WORK_TREE=/srv/www/limeblast.co.uk/htdocs_test
  export GIT_DIR=/srv/www/limeblast.co.uk/.git
  cd $GIT_WORK_TREE
  
  git checkout -f master
  git submodule init
  git submodule update
  </code></pre>
  
  <p>This all seems fine in theory, and it would appear that the submodule commands are running, but I'm getting the following error messages back:</p>
  
  <p><em>remote: Submodule 'wordpress' (git://github.com/WordPress/WordPress.git) registered for path 'wordpress'</em>
  <em>remote: Submodule 'wp-content/themes/limeblastevolution/inc/cssCrush' (git://github.com/peteboere/css-crush.git) registered for path 'wp-content/themes/limeblastevolution/inc/cssCrush'</em>
  <em>remote: fatal: working tree '/srv/www/limeblast.co.uk/htdocs_test' already exists.</em>
  <em>remote: Clone of 'git://github.com/WordPress/WordPress.git' into submodule path 'wordpress' failed</em></p>
  
  <p>Any ideas? Thank you.</p>