git 只clone仓库的某个文件夹
·
以下命令必须在git bash中运行,不能在powershell或者CMD中运行
$ mkdir pcl-examples
$ cd pcl-examples #make a directory we want to copy folders to
$ git init #initialize the empty local repo
$ git remote add origin -f https://github.com/PointCloudLibrary/pcl.git #add the remote origin
$ git config core.sparsecheckout true #very crucial. this is where we tell git we are checking out specifics
$ echo "examples/*" >> .git/info/sparse-checkout #recursively checkout examples folder
$ git pull --depth=2 origin master #go only 2 depths down the examples directory
更多推荐
所有评论(0)