一 问题发生背景
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。
四 解决方式
- 在 git bash 输入命令 git config --global ssh.variant ssh
- 对 git 进行降级处理
- 在系统变量中添加:变量 GIT_SSH_VARIANT 值 ssh
网友评论