生成ssh密钥,用如下命令 ssh-keygen -t rsa -f ~/.ssh/id_rsa.key2 配置config文件 在~/.ssh目录下新建一个文件 config,包含以下内容 Host gitlab服务器地址 IdentityFile ~/.ssh/id_rsa.key2 User 用户名