【问题标题】:Why can't I push new tags to server为什么我不能将新标签推送到服务器
【发布时间】:2013-11-20 22:49:15
【问题描述】:

我刚刚标记了一个版本,我正在尝试将标记推送到服务器,但我收到以下错误

$ 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

【问题讨论】:

  • 服务器有一个 git 钩子拒绝你的标签。 More on hooks.
  • 它不能......我设置了服务器......哈哈。与 gitolite..
  • 这是 GitLab 的 gitolite 吗?
  • 我不认为 gitlab 我该如何检查
  • 您的gitolite.conf 中有什么内容?

标签: git ssh gitolite


【解决方案1】:

Gitolite 问题

older StackOverflow question 解决了同样的问题。总结:

  • 您需要RW+ 权限才能更改/删除参考(更改您的gitolite configuration)。根据您的 gitolite 配置,您可能希望:

    RW+ refs/tags = @releasers # Allow @releasers to push tags

    以前阻止这种情况的是拒绝所有其他权限。

    - = @all # deny all other permissions

  • 更新 Gitolite 可能会有所帮助(确保更新密钥和存储库)

服务器端挂钩

由此看来,server side hook 可能会阻止您推送标签。

在远程端,查看 git 文件夹中的 hooks 文件夹。预接收或更新挂钩可能是问题挂钩。

使用武力

另一方面,您也可以尝试强制推送标签git push -f --tags

【讨论】:

  • 我不知道如何解决它
【解决方案2】:

我修好了..我必须在conf中添加以下内容

 RW refs/tags = @releasers

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-09-03
    • 1970-01-01
    • 2012-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-25
    相关资源
    最近更新 更多