{"thread":{"id":"39673","subject":"Selectively clone Git submodules -- a useful feature?","startedAt":"2015-06-18T20:55:42Z","lastAt":"2016-03-16T20:47:00Z","messageCount":3,"participants":["Lars Schneider","Jens Lehmann","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"264246","messageId":"162A5ADF-1FDD-432B-B5F8-672DF5B50EEC@gmail.com","threadId":"39673","inReplyTo":null,"subject":"Selectively clone Git submodules -- a useful feature?","fromName":"Lars Schneider","fromEmail":"larsxschneider@gmail.com","sentAt":"2015-06-18T20:55:42Z","receivedAt":"2015-06-18T20:55:42Z","isPatch":false,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"Hi,\n\nAFAIK Git has two ways to clone a repository with respect to submodules:\n\n(1) Plain clone of just the repository itself:\ngit clone git://github.com/foo/bar.git\n\n(2) Recursive clone of the repository including all its submodules:\ngit clone --recursive git://github.com/foo/bar.git\n\nI 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:\n\ngit submodule update --init --recursive --exclude 3rdParty/Windows/*\n\nor even:\n\ngit clone --recursive --exclude 3rdParty/Windows/* git://github.com/foo/bar.git\n\nPlease let me know what you think.\n\n\nThanks,\nLars\n\n\nPS: I posted this question already on the Google Git group here:\nhttps://groups.google.com/forum/?fromgroups=#!topic/git-users/jyKsd45d2MA\n\nI am sorry, but I discovered this mailing list afterwards and I am not sure which one is the appropriate one. Please advise.\n\n\n---\nhttps://larsxschneider.github.io/"},{"id":"264359","messageId":"558468B2.2010307@web.de","threadId":"39673","inReplyTo":"162A5ADF-1FDD-432B-B5F8-672DF5B50EEC@gmail.com","subject":"Re: Selectively clone Git submodules -- a useful feature?","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2015-06-19T19:08:34Z","receivedAt":"2015-06-19T19:08:34Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 18.06.2015 um 22:55 schrieb Lars Schneider:\n> AFAIK Git has two ways to clone a repository with respect to submodules:\n>\n> (1) Plain clone of just the repository itself:\n> git clone git://github.com/foo/bar.git\n>\n> (2) Recursive clone of the repository including all its submodules:\n> git clone --recursive git://github.com/foo/bar.git\n>\n> I am working on a big cross platform project and on certain platforms I don't\n > need certain submodules. AFAIK there is no way to selectively clone only a\n > subset of the submodules with the standard command line interface. I wonder\n> if something like an exclude pattern for submodules would be of general interest.\n > I imagine a call like this after a plain \"clone\" operation:\n>\n> git submodule update --init --recursive --exclude 3rdParty/Windows/*\n\nGit already supports that use case: Just set the \"submodule.<name>.update\"\nconfiguration to \"none\" for all submodules you aren't interested in and\n\"git submodule update\" will always skip them.\n\nYou can also set this config option globally:\n\ngit config --global submodule.<name>.update=none\n\nThat'll set the default for all repositories of the logged in user on this\ncomputer to not update submodule <name>.\n\n> or even:\n>\n> git clone --recursive --exclude 3rdParty/Windows/* git://github.com/foo/bar.git\n\ngit clone will be influenced by the global setting. If you just want to\nskip submodule <name> for a single clone you can do it like this:\n\n   git -c submodule.<name>.update=none clone --recursive git://github.com/foo/bar.git\n"},{"id":"280958","messageId":"CAGZ79kbu0JHbk8_CeY+2hDATMJ_QkYBhMbyh78jqKyf+h+vpdA@mail.gmail.com","threadId":"39673","inReplyTo":"162A5ADF-1FDD-432B-B5F8-672DF5B50EEC@gmail.com","subject":"Re: Selectively clone Git submodules -- a useful feature?","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-03-16T20:47:00Z","receivedAt":"2016-03-16T20:47:00Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, Jun 18, 2015 at 1:55 PM, Lars Schneider\n<larsxschneider@gmail.com> wrote:\n> Hi,\n\nHi,\n\nsorry for a real late answer to this,\n\n>\n> AFAIK Git has two ways to clone a repository with respect to submodules:\n>\n> (1) Plain clone of just the repository itself:\n> git clone git://github.com/foo/bar.git\n>\n> (2) Recursive clone of the repository including all its submodules:\n> git clone --recursive git://github.com/foo/bar.git\n>\n> 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:\n>\n> git submodule update --init --recursive --exclude 3rdParty/Windows/*\n>\n> or even:\n>\n> git clone --recursive --exclude 3rdParty/Windows/* git://github.com/foo/bar.git\n>\n> Please let me know what you think.\n\nI am looking forward for exactly that feature, I even proposed exactly this\n(in form of RFC patches, see\nhttp://thread.gmane.org/gmane.comp.version-control.git/281670)\n\nI plan on reviving this soon. Did you solve this problem as Jens proposed\nor are you still looking for a solution?\n\nThanks,\nStefan\n\n>\n>\n> Thanks,\n> Lars\n>\n>\n> PS: I posted this question already on the Google Git group here:\n> https://groups.google.com/forum/?fromgroups=#!topic/git-users/jyKsd45d2MA\n>\n> I am sorry, but I discovered this mailing list afterwards and I am not sure which one is the appropriate one. Please advise.\n>\n>\n> ---\n> https://larsxschneider.github.io/--\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}