gitlab使用非22ssh端口号clone出错

· 更新于

gitgitlabssh

默认会出错

$ git clone git@192.168.1.1:group1/test1.git
Cloning into 'lbtest1'...
git@192.168.1.62's password:
Connection closed by 192.168.1.62 port 22
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我们应该使用如下格式

`git clone ssh://git@hostname:port/.../xxx.git`

实际如下:

`git clone ssh://git@192.168.1.1:SSH新端口号/group1/lbtest1.git`