一 背景
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 版本。
鏈接:https://www.jianshu.com/p/901ae47bc073