【问题标题】:Pushing to the repository created by Gitlab fails with error推送到 Gitlab 创建的存储库失败并出现错误
【发布时间】:2019-03-25 16:12:57
【问题描述】:

推送到 GitLab 创建的仓库时出错, 我想提供建议。

推送操作本身,来自 Windows 10 PC, 我是用 TortoiseGit 做的。

[显示错误信息]

git.exe push --progress "origin" master: master

枚举对象:8,完成。计数对象:100% (8/8),完成。 使用多达 8 个线程的 Delta 压缩。压缩对象:100% (3/3),完成。写入对象:100% (6/6),532 字节 | 532.00 千字节/秒, 完毕。总共 6 个(增量 0),重复使用 1 个(增量 0)远程: /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_net.rb:153:in parse_who ': 未定义的方法 start_with?'对于零:NilClass (NoMethodError) 远程:从 /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_net.rb: 31: 在 check_access' 远程:来自 /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_access.rb:27:in 阻塞在 exec ' 远程:从 /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_metrics.rb: 50: 在测量'远程:从 /opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_access.rb:26:在 exec ' remote: from hooks / pre-receive: 30: in ` ' To ssh: // : / ~ / /test_system.git ! [remote denied] master -> master (pre-receive hook denied) 错误:未能将一些引用推送到'ssh:// git @:/〜/ /test_system.git'

git 没有正常结束(退出代码 1)(1125 ms @ 2018/10/21 16:47: 10)

如果你能给我建议,我会很高兴。 谢谢。

附加信息:

系统信息 系统: 当前用户:git 使用 RVM:否 红宝石版本:2.4.4p296 宝石版本:2.7.6 捆绑器版本:1.16.2 耙版本:12.3.1 Redis 版本:3.2.11 Git版本:2.18.1 Sidekiq 版本:5.1.3 Go 版本:未知

GitLab 信息 版本:11.3.5 修订:c74e8d9 目录:/opt/gitlab/embedded/service/gitlab-rails 数据库适配器:postgresql 网址:
HTTP 克隆网址: SSH 克隆网址:
使用 LDAP:否 使用 Omniauth:否

GitLab 外壳 版本:8.3.3 存储库存储路径: - 默认值:/var/opt/gitlab/git-data/repositories 钩子:/opt/gitlab/embedded/service/gitlab-shell/hooks Git:/opt/gitlab/embedded/bin/git

【问题讨论】:

    标签: ruby-on-rails git gitlab


    【解决方案1】:

    我不认为它来自 TortoiseGit 本身。但更有可能的是,Gitlab 的默认设置是保护master 分支。见Gitlab protected branches

    在您的情况下,您可以看到主要错误是:

    “![remote denied] master -> master (pre-receive hook denied) error: failed to push some refs”

    这意味着您的 remote(这里是您的 Gitlab 服务器)拒绝推送,原因是 "pre-receive hook declined"

    要更改它,请转到:Project > Settings > Repository > Protected branches

    您可以在此处删除或添加受保护的分支,并且可以编辑受保护分支的推送设置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-24
      • 1970-01-01
      • 2016-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-17
      • 1970-01-01
      相关资源
      最近更新 更多