0
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'
挤压,我们能够部署几次提交后,但我们遇到了一个问题,当我们有一个相当大的公关需要合并。为了避免错误
' ! [remote rejected] dev -> master (shallow update not allowed) '
我们将下面的脚本添加到我们的部署管道中,并且一切正常。
if [ -f ${HOME}/clone/.git/shallow ]; then git fetch --unshallow; fi
上述命令只会获取存储库的完整历史记录,如果它是浅表克隆。 Codeship建议在部署之前直接添加(例如,通过基于脚本的部署),以便在您仅运行测试时不会获取所有修订。 如果部署基于执行'git push',集成部署会自动释放存储库。 – mlocher
我们正在运行基于脚本的部署,因此我们必须添加此部署。我们之前没有遇到这个问题,谷歌搜索返回完全不同的答案。因为codeship使用浅层克隆来加速构建过程,所以这只是pr超过50次提交的一个问题。我只是想把这个扔给那些可能需要它的人。谢谢你。 – arenfroe