我刚刚标记了一个版本,我正试图将标记推送到服务器,但我收到以下错误
$ git push --tags
Counting objects: 1, done.
Writing objects: 100% (1/1), 190 bytes, done.
Total 1 (delta 0), reused 0 (delta 0)
remote: FATAL: W refs/tags/v3.1.01 project xxsmith DENIED by refs/.*
remote: error: hook declined to update refs/tags/v3.1.01
To ssh://git@server/project
! [remote rejected] v3.1.01 -> v3.1.01 (hook declined)
error: failed to push some refs to 'ssh://git@server/project'
这是为什么?我拥有该帐户的全部权利。
我正在使用 gitolite.. 可以使用以下设置吗
repo project
RW+ master = @releasers # allow @releasers access to release branch
- master = @developers # deny @developers access to release branch
RW develop = @developers # allow @developers access to development branch
RW+ develop = @releasers # allow @developers access to development branch
- = @all # deny all other permissions
最佳答案
Gitolite 问题
有一个 older StackOverflow question这解决了同样的问题。总结:
您需要
RW+
权限才能更改/删除引用(更改您的 gitolite configuration )。根据您的 gitolite 配置,您可能需要:RW+ refs/tags = @releasers # 允许@releasers 推送标签
之前阻止这种情况的是拒绝所有其他权限。
- = @all # 拒绝所有其他权限
更新 Gitolite 可能会有所帮助(确保更新 key 和存储库)
服务器端 Hook
由此看来,它看起来像一个 server side hook可能会阻止您推送标签。
在远程端,查看 git 文件夹中的 hooks 文件夹。预接收或更新 Hook 可能是问题 Hook 。
使用原力
另一方面,您也可以尝试强制推送标签 git push -f --tags
。
关于git - 为什么我不能将新标签推送到服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19867323/