GitLab CI: git 拉而不是 git 克隆

GitLab CI: git pull instead git clone

我在服务器上有 git 目录。 我想在 Master 分支中每次推送 git 拉入此目录。 我尝试使用 gitlab-ci-multi-runner 来做到这一点。 我制作了 shell runner,但默认情况下他会克隆存储库,然后调用我的命令。

如何在 git 拉取时更改 git 克隆?

在“项目设置”页面的 "Builds" 下,将 git clone 更改为 git fetch

注意,git pull 执行 git fetch 后跟 git merge。所以你不希望 CI 到 git pull。 GitLab CI 执行 git fetch 后跟 git checkout <commit>.