GIT_WORK_TREE and GIT_DIR with git clone
- From
Cosmin Apreutesei <cosmin.apreutesei@gmail.com>
- Date
- Jan 20, 2014, 15:59 UTC
- Message-ID
- <CAKJdRamFDDWRZDHBCe7GrXg0OWhLfBPq_ofsvowaW9d8VOGTMA@mail.gmail.com>
Hi,
I would like to have git clone respect GIT_DIR (and --git-dir) so I can clone multiple repos into the same working directory (I know there was another request for this[1]).
The pattern here is big projects that are modularized into multiple git repositories, but supposed to be overlaid over a common directory structure.
I would like to be able to tell my users that they can simply do:
git clone --git-dir=_/git/module1/.git module1-url git clone --git-dir=_/git/module2/.git module2-url
which will overlay the files from both modules into the current directory, which from git's perspective is the work-tree for both modules.
[1] http://article.gmane.org/gmane.comp.version-control.git/170073/match=git_work_tree+git_dir+git+clone