使用ssh-keygen -t rsa -C “你的email” 生成密钥和公钥,然后把.pub添加到git上面。
平时使用git sh都没问题,但是在使用jgitflow的时候报错:
[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start (default-cli) on project wealth-user-service: Execution default-cli of goal external.atlassian.jgi tflow:jgitflow-maven-plugin:1.0-m5.1:release-start failed: ssh://git@gitlab.jinhui365.cn:22: The authenticity of host 'gitlab.jinhui365.cn' can't be established. [ERROR] RSA key fingerprint is 61:0f:8e:8e:87:d8:c3:05:ed:53:96:b3:f1:47:ec:52. [ERROR] Are you sure you want to continue connecting? [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
然后经过查询,发现konw_hosts文件缺少了git,使用下面命令加入:
ssh-keyscan gitlab.jinhui365.cn >> ~/.ssh/known_hosts