{"thread":{"id":"29120","subject":"git submodules and custom work tree / git dir","startedAt":"2011-12-09T16:48:22Z","lastAt":"2011-12-09T16:48:22Z","messageCount":1,"participants":["Michael Gorbach"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"180671","messageId":"loom.20111209T173452-58@post.gmane.org","threadId":"29120","inReplyTo":null,"subject":"git submodules and custom work tree / git dir","fromName":"Michael Gorbach","fromEmail":"michael@mgorbach.name","sentAt":"2011-12-09T16:48:22Z","receivedAt":"2011-12-09T16:48:22Z","isPatch":false,"sender":{"key":"michael@mgorbach.name","avatar":null},"body":"I am working on a setup for managing my personal config files \n(shell settings and vim settings and such) using git. \n\nI have a git repository which ignores all files by default, so they don't \ncloud status. I have the following aliases:\nalias config='git --git-dir=$HOME/.config.git/ --work-tree=$HOME'\nalias config-add='git --git-dir=$HOME/.config.git --work-tree=$HOME add -f'\n\nThis works pretty well. It means that the config repo is separate from other \ngit repos, and I won't accidentally touch it by just typing \"git.\"\nWhat I'm trying to do now is to track vim (bundle) modules inside this git \nrepo, which requires the use of git submodules.\nIt appears that submodules don't work with this weird configuration.\n\nBy calling git as in the \"config\" alias above, except removing the --work-tree \nargument, I was able to add submodules successfully with git submodule add. The\nsubmodule info is written into .gitmodules and .config.git/config as expected. \nHowever,  the submodule doesn't seem to \"stick.\" It displays when I type  \n\"config status\" as \"untracked content\" no matter what I do, even though \nthere is no untracked content and no change in the submodule.\n\nIs there a way to make submodules work reasonably with git when using the \n--work-tree and --git-dir arguments?\n"}]}