I am trying to get GitLab working on my server (running CentOS 6.5). I followed the gitlab-receipe to the line, but I just can\'t get it working. I am able to access the web
change the shell of git
usermod -s /usr/bin/git-shell git
The solution for me was to unset the GIT_SSH env variable which was pointing to putty (plink.exe)
Another thing to check is that your .bashrc does not print extra stuff. For example 'echo "hello"' in .bashrc creates the error:
kruus@borg:~/malt$ ssh snake01
Last login: Tue Oct 21 10:44:31 2014 from 138.15.166.103
hello
...
kruus@snake01:/net/snake01/usr/hydra/kruus/malt$ git pull
fatal: protocol error: bad line length character: hell
Note how saying hello caused one hell of a problem.
Removing the 'echo "hello"' from my .bashrc allows git to work as expected again. You may need to ">& /dev/null" to remove output if your .bashrc does more complicated things.
sudo gitlab-ctl reconfigure
and then
sudo gitlab-ctl restart
should do the trick
My solution on Windows was switching the connection to SSH in .git/config:
[remote "origin"] url = git@github.com:
As described here:
https://help.github.com/en/articles/changing-a-remotes-url
You can get the actual error message by doing:
ssh git@yourgitlabserver.com "git-upload-pack yournamespace/yourreponame.git"
According to this git documentation git protocol expects at the beginning of each line its size and then the content. Looks like GitLab doesn't do that and sends the error message directly.