美文网首页
解决git fetch关联子项目出现的权限问题“Server d

解决git fetch关联子项目出现的权限问题“Server d

作者: 沉思的雨季 | 来源:发表于2020-05-27 14:33 被阅读0次

问题现象:

在使用gitlab-runner自动部署的时候,git拉取子项目时出现类似错误:Server does not allow request for unadvertised object a99a0b08d8c79fdf8d6745a9e3b.

问题分析:

git客户端在fetch Gitlab指定commit时,出现权限问题是因为gitlab的upload-pack选项默认不允许第三方子项目的提取请求。

解决思路:

编辑gitlab配置文件/opt/gitlab/embedded/etc/gitconfig,设置allowReachableSHA1InWant项为true。命令如下:

[root@localhost]#vi  /opt/gitlab/embedded/etc/gitconfig

config

[pack]

threads = 1

[receive]

fsckObjects = true

advertisePushOptions = true

[repack]

writeBitmaps = true

[transfer]

hideRefs=^refs/tmp/

hideRefs=^refs/keep-around/

hideRefs=^refs/remotes/

[core]

alternateRefsCommand="exit 0 #"

fsyncObjectFiles = true

[uploadpack]

allowAnySHA1InWant = true  #添加uploadpack设置,允许获取第三方子项目

相关文章

网友评论

      本文标题:解决git fetch关联子项目出现的权限问题“Server d

      本文链接:https://www.haomeiwen.com/subject/dyfqahtx.html