簡體   English   中英

git 推送不適用於 gitlab (mingw) — 如果 ssh 有效,會有什么問題?

[英]git push not working for gitlab (mingw) — what is the issue if ssh works?

我有一台 windows PC 試圖通過 ssh 連接到 gitlab。 我已經測試了 ssh 連接工作正常:

user MINGW32 /z/www/project (master)
$ ssh -T git@gitlab.foo.com
Welcome to GitLab, @user!

但是推送不起作用:

user MINGW32 /z/www/project (master)
$ git push origin master
fatal: protocol error: bad line length character: git@
Access denied
Access denied
Access denied
Access denied
Access denied
FATAL ERROR: Server sent disconnect message
type 2 (protocol error):
"Too many authentication failures"

這是之前設置的原點:

$ git remote add origin git@gitlab.foo.com:my-project/project.git
$ git remote --verbose: 
origin  git@gitlab.foo.com:my-project/project.git (fetch)
origin  git@gitlab.foo.com:my-project/project.git (push)

這些錯誤看起來像是在嘗試許多鍵並最終失敗,但我不明白 ssh 是如何工作的。 同樣在 my.ssh 文件夾中,我只有 1 個密鑰。

其他故障排除:

ssh git@gitlab.foo.com git-receive-pack my-project/project.git
009a0000000000000000000000000000000000000000 capabilities^{}report-status delete-refs side-band-64k quiet atomic ofs-delta push-options agent=git/2.22.0
0000

ssh git@gitlab.foo.com /bin/true
> GitLab: Disallowed command

有人有什么想法嗎?

謝謝!

知道了!

這個環境變量把一切都搞砸了: GIT_SSH=C:\Program Files\PuTTY\plink.exe一旦我們unset GIT_SSH ,它就起作用了。

歸功於以下評論之一: https://stackoverflow.com/a/35913460/523173

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM