{"thread":{"id":"40320","subject":"git submodule ignores --git-dir","startedAt":"2015-09-10T20:06:21Z","lastAt":"2015-09-10T20:06:21Z","messageCount":1,"participants":["Filip Gospodinov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"269733","messageId":"55F1E2BD.3030103@monetas.net","threadId":"40320","inReplyTo":null,"subject":"git submodule ignores --git-dir","fromName":"Filip Gospodinov","fromEmail":"filip.gospodinov@monetas.net","sentAt":"2015-09-10T20:06:21Z","receivedAt":"2015-09-10T20:06:21Z","isPatch":false,"sender":{"key":"filip.gospodinov@monetas.net","avatar":null},"body":"Hi!\n\nI use the `--git-dir` flag in some scripts such that I don't need to `cd` back\nand forth. Recently, I've discovered that `--git-dir` does not seem to work\ncorrectly for `git submodule`. Here is a short snippet to reproduce that behavior:\n\nmkdir repo1 subm\n(cd subm; git init; git commit -m 1 --allow-empty)\n(cd repo1; git init; git submodule add ../subm subm; git commit -m \"add subm\")\ngit clone repo1 repo2\ngit --git-dir=$PWD/repo2/.git submodule update --init\n\n\nwhich errors with the following output:\n\nNo submodule mapping found in .gitmodules for path 'subm'\n\nBut this works:\ncd repo2; git --git-dir=$PWD/.git submodule update --init\n\n\nI know that for this particular use case I can just use `git clone --recursive`\nand that other use cases can be worked around by using `cd`. Still, I wonder if\nthe behavior I discovered is a bug or if it's expected.\n\ngit --version\ngit version 2.5.1\n\nThanks you!\nFilip\n"}]}