gitlab-shell:不允许的命令

rap*_*elj 4 git ssh shell gitlab

我在Ubuntu 14.04上安装了最新版本的GitLab,除了推送到遥控器外它工作正常.

跑步ssh git@example.com "git-receive-pack repo.git"效果很好.在〜/ gitlab-shell/gitlab-shell.log中,结果是

信息 - :gitlab-shell:使用密钥key-1为用户执行git命令git-receive-pack repo.git.

但是当我跑步时git push,日志说:

警告 - :gitlab-shell:用户使用密钥key-1尝试执行不允许的命令git receive-pack'repo.git'.

输出是:

致命:协议错误:行长字符错误:Disa

输出ssh git@example.com "git receive-pack repo.git"

"不允许的命令"

所以允许和不允许之间的区别是缺少破折号.

我的git版本:

  • 本地git版本:2.2.1(OS X)
  • 远程git版本:1.9.1(Ubuntu 14.04)

我该如何解决这个问题?有配置参数吗?

小智 6

我一直有同样的问题,编辑〜/ .gitconfig解决了这个问题.

在过去的某个时候,某些东西修改了我的本地〜/ .gitconfig文件并插入了这个条目:

[remote "origin"]
        receivepack = git receive-pack
Run Code Online (Sandbox Code Playgroud)

我将其修改为以下内容,现在一切正常.

[remote "origin"]
        receivepack = git-receive-pack
Run Code Online (Sandbox Code Playgroud)