gitlab拉取指定目录

  • gitlab拉取指定目录已关闭评论
  • 123 次浏览
  • A+
所属分类:linux技术
摘要

最后拉到的目录是 1.1.1.220930-aplha


1.新建目录

mkdir git 

2.初始化本地目录

git init 

3.启用过滤的配置项

git config core.sparsecheckout true 

4.想要拉取哪个文件夹,就将其写入下述文件中,注意 .git 是隐藏文件夹,使用git-bash可以正常访问

echo 1.1.1.220930-aplha > .git/info/sparse-checkout 

5.拉取项目

git pull http://172.26.0.5:30000/deply/prod.git 

最后拉到的目录是 1.1.1.220930-aplha