Git subtree: Use only subrepository instead of whole repository

孤街醉人 提交于 2019-12-03 05:14:28
VonC

Normally, a git repo is done to be fully cloned/loaded.

You could go for a sparse checkout (Git1.7+), but only if you don't intent to do any modification and push those 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 origin git://github.com/iwein/Spring-Integration-Sandbox.git
(master) $ git pull origin master

The OP user2070238 reports:

This worked with a few changes.
Because, I use submodule I had to use

 echo MY_FOLDER/* >> .git/info/modules/MY_MODULE/sparse-checkout 

And for some reason the MY_FOLDER/ part was not working without *

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!