1. 程式人生 > >git報錯:ssh variant 'simple' does not support setting port解決【有效】

git報錯:ssh variant 'simple' does not support setting port解決【有效】

一  背景

git 升級到 2.16.x 版本之後,在 Android Studio 上去使用 git 命令以 ssh 方式去 fetch 遠端的 branch。

二 異常現象

Android studio 報了一個異常,ssh variant 'simple' does not support setting port ,即 ssh variant 不支援埠號。

三 分析原因

使用 ssh 方式拉取程式碼的時候,使用的命令帶有埠號。而在 git 2.16.x 版本上 ssh variant 需要手動設定為 ssh。

四 解決方式

1. 在 bash 輸入 git config --global ssh.variant ssh

2. 對 git 進行降級處理,即降低 git 版本。



作者:cindychendd
連結:https://www.jianshu.com/p/901ae47bc073
來源:簡書
簡書著作權歸作者所有,任何形式的轉載都請聯絡作者獲得授