Gitlab-shell: Attempt to execute disallowed command <git receive-pack

When I try to do a “git push”, gitlab_shell.rb is throwing a DisallowedCommandError exception because “git” is not in the GIT_COMMANDS variable. That is, when I do a local “git push”, instead of “git-receive-pack” being sent over the wire, my git client is sending “git receive-pack”.

I am connecting from a Mac, so:

git --version
git version 2.3.2 (Apple Git-55)

The offending lines in gitlab-shell.rb are:

GIT_COMMANDS = %w(git-upload-pack git-receive-pack git-upload-archive git-annex-shell).freeze


raise DisallowedCommandError unless GIT_COMMANDS.include?(@git_cmd)

Any tips on fixing this? I could hack the gitlab-shell.rb source to accept “git” as a command, and go down that path, but that seems generally unwise and painful to maintain.


Problem solved. Something, at some time in the past, had modified my local ~/.gitconfig file and inserted this entry:

[remote "origin"]
        receivepack = git receive-pack

I modified it to the following, and now everything works well.

[remote "origin"]
        receivepack = git-receive-pack
1 Like