GitLab returns 各种致命错误

GitLab returns various fatal errors

我最近在使用 Git 和 SSH 时遇到了几个问题,包括 git pull 无法正常工作。我和同事使用相同的 Git 实验室服务器,但我遇到了他们从未遇到过的问题。

当我输入 git pull 我得到

fatal: protocol error: bad line length character: gitl

我已与同事核实 git 远程设置正确。

由于问题只出现在这台电脑上,我也很确定问题出在这台电脑上。

我所知道的是这可以正常工作:

$ ssh -Tv -p 22 gitlab@svn.faktab.net
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to svn.faktab.net [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/bls/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/bls/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/bls/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/bls/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/bls/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/bls/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/bls/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/bls/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to svn.faktab.net:22 as 'gitlab'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr umac-64@openssh.com none
debug1: kex: client->server aes128-ctr umac-64@openssh.com none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:FTlgQR6hN/JPOGtpLA/bRwg0cwyYtWC8QCSf4jQA5O0
debug1: Host 'svn.faktab.net' is known and matches the RSA host key.
debug1: Found key in /c/Users/bls/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/bls/.ssh/y
debug1: Remote: Forced command: /var/gitlab/gitlab-shell/bin/gitlab-shell key-128
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug1: Remote: Forced command: /var/gitlab/gitlab-shell/bin/gitlab-shell key-128
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Authentication succeeded (publickey).
Authenticated to svn.faktab.net ([xxx.xxx.xxx.xxx]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
Welcome to GitLab, X X!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 4304, received 3696 bytes, in 0.1 seconds
Bytes per second: sent 29078.1, received 24970.4
debug1: Exit status 0

为什么我无法让 git pull 正常工作?

为什么不从项目主页复制 ssh url?

大概是:gitlab@svn.faktab.net/pospayclient/api.git

所以没有 ssh://.

经过数小时的跟踪和错误后,我开始工作了

  • 卸载腻子
  • 卸载Git
  • 删除项目
  • 重启电脑
  • 重新安装Git
  • 创建新的 SSH 密钥并添加到 Git实验室配置文件
  • 再次克隆所有项目