git拉取单个目录
有时git库里的东西比较多,我们只希望像SVN一样,只拉取git库的一个目录。
例如:基础代码仓库infra-code_ops有很多基础代码,我们只想拉取仓库里nginx-conf目录的文件。
$
git init infra-code_ops-nginx && cd infra-code_ops-nginx //初始化仓库,并进入该目录
$ git remote add -f origin http:
//gitlab.xxx.com/ops/infra-code_ops.git //添加远程仓库地址
$ git config core.sparsecheckout
true //开启sparse checkout功能
$ echo
"nginx-conf/"
>> .git/info/sparse-checkout //将nginx-conf/目录写入到该文件中
$ cat .git/info/sparse-checkout //确认查看该文件内容
$ git pull origin master //拉取远程master分支
洛谷4147:玉蟾宫——题解
洛谷1578:[WC2002]奶牛浴场——题解
BZOJ1926:[SDOI2010]粟粟的书架——题解
BZOJ3123:[SDOI2013]森林——题解
BZOJ1834:[ZJOI2010]网络扩容——题解
BZOJ2668:[CQOI2012]交换棋子——题解
BZOJ1070:[SCOI2007]修车——题解
BZOJ1877:[SDOI2009]晨跑——题解
在阿里,我们如何管理测试环境