Friday, 15 July 2011

Git subtree: Use only subrepository instead of whole repository -



Git subtree: Use only subrepository instead of whole repository -

i have project uses 3rd party libraries. directory construction like:

my_cool_project 3rdparty lib_1 lib_2 source my_project

the libraries located in separate repositories. so, if want utilize git repository 3rd party libraries can do:

git subtree add together --prefix 3rdparty/lib_1 --squash http://my3rdpartylibs.com/lib1.git master

however, within lib1.git repository there 1 bin folder need. contains folders such documentation, examples, etc. how can "connect" repository lib1/bin folder instead of whole repository? possible?

normally, git repo done cloned/loaded.

you could go sparse checkout (git1.7+), if don't intent modification , force back. see this example:

$ git init initialized empty git repository in /tmp/si-sandbox/.git/ (master) $ git config core.sparsecheckout true (master) $ echo message-store/ >> .git/info/sparse-checkout (master) $ git remote add together origin git://github.com/iwein/spring-integration-sandbox.git (master) $ git pull origin master

the op user2070238 reports:

this worked few changes. because, utilize submodule had utilize

echo my_folder/* >> .git/info/modules/my_module/sparse-checkout

and reason my_folder/ part not working without *

git git-subtree

No comments:

Post a Comment