开发者

Git not working with remote server

开发者 https://www.devze.com 2023-03-24 05:27 出处:网络
I have git installed and working as expected on my local system or a 开发者_开发百科network share, but have not been able to get it to access the remote bare repository on my server using ssh.

I have git installed and working as expected on my local system or a 开发者_开发百科network share, but have not been able to get it to access the remote bare repository on my server using ssh.

I have installed msysgit and CopSSH on the server and msysgit, putty and tortoisegit on my local system. I am able to open a putty session or use plink successfully -- at least I believe plink is successful, but more on that in a bit.

When I attempt to clone a remote repository I get this:

D:\Temp> git clone uname@server:e:/path/test.git Test
Cloning into Test...
fatal: protocol error: bad line length character: Micr

The error message has been consistent for a while, but at times (from one reinstall attempt to another) the last four characters will be 'Micr', 'Allo' or something else I don't remember right now. In the currently installed state it is 'Micr'.

So the big question is what am I not doing right?

Although I imagine it would be much easier to correct what was wrong if I could get the actual error message instead of the generic one followed by the first four characters of the actual error message. Any idea if that is possible?


First, you have variables like export GIT_TRACE=1 and export GIT_TRACE_PACKET=1 which can help debugging this kind of situation.

Second, this error is often caused by any kind of display done during the ssh session (see for instance this thread), like a .bashrc on the server side with an echo in it.

I have a wrapper set-up around ssh that sets the window title of the shell to the ssh command argument. That is what messes things up!

See also Git FAQ

Other causes include:

  • using the right ssh
  • correctly forcing to use git-shell
  • using --exec-path from the server_arg on the server side

Note: with Git 2.6+ (Q3 2015), see also "GIT_TRACE_PACKFILE".

0

精彩评论

暂无评论...
验证码 换一张
取 消