TechTip: How to Git clone subdirectories

The git usage is very widespread among the developers! Through the use of the public or private repository is possible to store code, track versions and share and collaborate with teammate and/or entire communities.

But every repository may contain docs, examples or other files near the needed application. When it’s time to build an application which is composed of files contained in many libraries, the need to “purge” code from unnecessary files become mandatory. In the same way, the continuous pull of dependent libraries could depend on the release of the application.

Git can pull a directory contained in a sub-repository simply enabling “sparseCheckout” config in the root Repository.

Then enable “sparseCheckout” option

Every directory is needed in local repo must be indicated “spare-checkout” file under .git/info directory

Next issue a simple git pull.

Enjoy

   Send article as PDF   

Un pensiero riguardo “TechTip: How to Git clone subdirectories

I commenti sono chiusi