Selectively clone Git submodules -- a useful feature?
- From
Lars Schneider <larsxschneider@gmail.com>
- Date
- Jun 18, 2015, 20:55 UTC
- Message-ID
- <162A5ADF-1FDD-432B-B5F8-672DF5B50EEC@gmail.com>
Hi,
AFAIK Git has two ways to clone a repository with respect to submodules:
(1) Plain clone of just the repository itself: git clone git://github.com/foo/bar.git
(2) Recursive clone of the repository including all its submodules: git clone --recursive git://github.com/foo/bar.git
I am working on a big cross platform project and on certain platforms I don't need certain submodules. AFAIK there is no way to selectively clone only a subset of the submodules with the standard command line interface. I wonder if something like an exclude pattern for submodules would be of general interest. I imagine a call like this after a plain "clone" operation:
git submodule update --init --recursive --exclude 3rdParty/Windows/*
or even:
git clone --recursive --exclude 3rdParty/Windows/* git://github.com/foo/bar.git
Please let me know what you think.
Thanks, Lars
PS: I posted this question already on the Google Git group here: https://groups.google.com/forum/?fromgroups=#!topic/git-users/jyKsd45d2MA
I am sorry, but I discovered this mailing list afterwards and I am not sure which one is the appropriate one. Please advise.
--- https://larsxschneider.github.io/