title: How can you use submodules with git-managed dotfiles?
body: <p>I use a git repository to manage my dotfiles, and I'm having the hardest time getting submodules to work right (most of my .vim has a lot of external plugins)</p>
  
  <p>I have an alias cgit to do (not sure if it's relevant)
      alias cgit='GIT_DIR=/home/myuser/.config-git GIT_WORK_TREE=/home/myuser/. git'"</p>
  
  <p>So, I can pull the repository with cgit pull, but I can't get submodules to checkout/update:</p>
  
  <pre><code>$ cgit submodule status
  -9895285042a2fd5691b2f6582aa979e4d1bdffea .vim/bundle/ack
  -e9267044261481fbb6717b482c2f3811eb61b409 .vim/bundle/command-t
  &lt;snip&gt;
  $ cgit submodule init
  $ cgit submodule update
  fatal: working tree '/home/myuser/.' already exists.
  Clone of 'https://github.com/mileszs/ack.vim.git' into submodule path '.vim/bundle/ack' failed
  $
  </code></pre>
  
  <p>I've tried removing that specific directory and trying again, and it just bombs. My .gitmodules doesn't have /home/myuser/. and my .config-git/config doesn't have any references to my home directory either, so I'm at a loss. If it helps, my version of git is 1.7.4.1</p>
  
  <p>thanks!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>It appears that first thing was a weird bug where git submodule wasn't accepting the environment variables (though other git commands were), but it required the command line arg be passed. Now, the clone works, it just complains (I fixed the ack config manually)</p>
  
  <pre><code>Cloning into '.vim/bundle/command-t'...
  remote: Counting objects: 2659, done.
  remote: Compressing objects: 100% (1089/1089), done.
  remote: Total 2659 (delta 1453), reused 2524 (delta 1325)
  Receiving objects: 100% (2659/2659), 447.42 KiB, done.
  Resolving deltas: 100% (1453/1453), done.
  fatal: Could not chdir to '../../../../../../../nfs_mounts/home/myuser/.vim/bundle/command-t': No such file or directory
  </code></pre>
  
  <p>And if I look in ~/.config-git/modules/.vim/ack/config, I see:</p>
  
  <pre><code>[core]
      repositoryformatversion = 0
      filemode = true
      bare = false
      logallrefupdates = true
      worktree = ../../../../../../../nfs_mounts/home/myuser/.vim/bundle/command-t
  [remote "origin"]
      fetch = +refs/heads/*:refs/remotes/origin/*
      url = https://github.com/wincent/Command-T.git
  [branch "master"]
      remote = origin
      merge = refs/heads/master
  </code></pre>
  
  <p>but if I 'ls' that worktree, it appears to be there. If I remove all the ../ , then try the git again it appears to work</p>