git clones some files
Demand
Just want to get the specified files or folders out of the Git repository. In SVN, this is very easy to implement, because SVN is stored in file mode, and Git is a metadata-based distributed store of file information, it will be in every clone of the time to retrieve all the information to the local, that is equivalent to build a clone version of the repository on your machine. Solution Solutions
This was not possible until Git1.7.0, but fortunately the sparse checkout mode was added after Git1.7.0, which made it possible to specify a file or folder for check out. Example
The following is an example of the/druid/doc directory under the clone Open source project Druid.
$ mkdir Druid
$ cd Druid
$ git init//Initialize empty warehouse
$ git Remote add-f origin https://github.com/alibaba/druid.git Associate Remote Address
$ git config core.sparsecheckout true//Open sparse Checkout mode
$ echo "Druid/doc" >>. Git/info/spars E-checkout//Set required check out file
$ Git pull origin master//check out ...
Summary Specifies the remote repository specified clone mode: Sparse clone mode Specifies the cloned folder (or file) to pull the remote file