6

I am using git for source control and hosting on github. We are trying to keep the repo as small as possible.

I decided to add boost to the project, which (relative to our requirements) is quite large. I have extracted a subset of the features required. Now I am a bit confused as to how to handle this on git. Should I add my subset of boost to the repository? If I add boost as a submodule, the download size is going to be a bit big (I assume, I haven't tested this).

How is this typically done?

unohoo
  • 378
  • 4
  • 14

2 Answers2

6

Unless you have a very good reason to do otherwise, leave boost as an external dependency. (don't add it to your repository at all).

James
  • 24,676
  • 13
  • 84
  • 130
4

UPDATE Actually not a good option, see comment

You can actually avoid downloading the whole boost history by specifying --depth when cloning it, this should make the download size quite near to a classic tar.gz archive.

See Git shallow submodules for details about it.

In your case, for Boost Bind it will be git clone --depth 1 git://gitorious.org/boost/bind.git and then link the repo as a submodule (see linked post).

Community
  • 1
  • 1
CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • How do I handle the dependency between boost projects when doing it this way? By using bcp I can select a subset of boost, and collect all dependencies together. – unohoo Sep 17 '12 at 14:33
  • You can't do it this way. You have to have one submodule per repository, so identify which one you need. More, you can't select which tag you want to clone, as per [git shallow clone to specific tag](http://stackoverflow.com/questions/8932389/git-shallow-clone-to-specific-tag). So forget about it and copy what you need from boost in your repo. – CharlesB Sep 17 '12 at 14:52
  • Yea I don't think I'll be able to do what I want to. I will just have to leave boost as an external dependency I think. Thanks for the help – unohoo Sep 17 '12 at 14:57