代码之家  ›  专栏  ›  技术社区  ›  kittygirl

如何使“稀疏签出”在接收后钩子签出期间有效?

git
  •  1
  • kittygirl  · 技术社区  · 6 年前

    我的系统是centos 7.4和git 1.8.3。
    this post sparse-checkout 在我的 remoteserver 裸回购协议如下:

    !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 还在结帐。

    自述文件 未按中的设置签出 ?

    1 回复  |  直到 4 年前
        1
  •  0
  •   VonC    6 年前

    先试试:

    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