由于浅克隆

时间:2016-07-29 18:06:10

标签: deployment codeship shallow-clone

Codeship提取深度为50的克隆来加速构建过程。我们有一个超过50次提交的拉取请求(不常见但发生)并且我们的催化部署失败并出现以下错误:

 Warning: Permanently added '<deployment host>
 to the list of known hosts.
 Counting objects: 6551, done.
 Delta compression using up to 32 threads.
 Compressing objects: 100% (2626/2626), done.
 Writing objects: 100% (6551/6551), 23.57 MiB | 16.37 MiB/s, done.
 Total 6551 (delta 3843), reused 6551 (delta 3843)
 To <>.git
 ! [remote rejected] dev -> master (shallow update not allowed)
 error: failed to push some refs to '<>.git'

在压缩了一些提交后,我们能够部署,但是当我们有一个需要合并的相当大的PR时,我们遇到了问题。为了避免错误

 ' ! [remote rejected] dev -> master (shallow update not allowed) '

我们在部署管道中添加了以下脚本,一切正常。

 if [ -f ${HOME}/clone/.git/shallow ]; then git fetch --unshallow; fi

1 个答案:

答案 0 :(得分:1)

我们在部署管道中添加了以下脚本,一切正常。

if [-f $ {HOME} /clone/.git/shallow];然后git fetch --unshallow;网络