我的系统是centos 7.4和git 1.8.3。
基于this post,我在我的remoteserver裸回购中设置了sparse-checkout如下:
!README.md
!.scrutinizer.yml
!.idea/*
!.idea_modules/*
/*我认为允许是对的:
[root@localhost info]# ls -al
total 8
drwxr-xr-x 2 root root 44 Jan 28 11:17 .
drwxr-xr-x 7 root root 132 Jan 28 11:33 ..
-rw-r--r-- 1 root root 240 Jan 28 14:33 exclude
-rw-r--r-- 1 root root 58 Jan 28 11:17 sparse-checkout当我git push remoteserver master时,post-receive钩子将运行:
git --work-tree="$DEPLOY_DIR" --git-dir="$GIT_DIR" checkout -f
问题是:
README.md和.scrutinizer.yml还在结账。
如何使README.md和.scrutinizer.yml在sparse-checkout中设置为非签出
发布于 2019-01-29 05:47:02
先试试:
git --work-tree="$DEPLOY_DIR" --git-dir="$GIT_DIR" config core.sparsecheckout true然后,您的钩子可以使用sparsecheckout检查内容,内容应该遵守exclusions you have declared指令。
但是:git1.8.3是相当古老的:请确保和upgrade it first if possible。
https://stackoverflow.com/questions/54413461
复制相似问题