1
我試圖用JGit從上GitLab一個存儲庫中讀取一些標籤。我可以用bash克隆版本庫,所以我知道我擁有權限等等。錯誤連接到GitLab與JGit
當我嘗試使用JGit來獲取標籤,我收到以下錯誤:
UnknownHostKey: gitlab.com. RSA key fingerprint is b6:03:0e:39:97:9e:d0:e7:24:ce:a3:77:3e:01:42:01
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:160)
at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:137)
at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:264)
at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:162)
at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:198)
... 49 more
Caused by: com.jcraft.jsch.JSchException: UnknownHostKey: gitlab.com. RSA key fingerprint is b6:03:0e:39:97:9e:d0:e7:24:ce:a3:77:3e:01:42:01
這是出乎意料的,因爲我已經中known_hosts
如下:
gitlab.com,52.167.219.168 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY=
- 是否JGit閱讀
known_hosts
默認? - 有沒有辦法來手動添加GitLab作爲一個著名主持人到JGit?
完美。所以JGit *不會*使用'known_hosts',我的文件只是配置錯誤。 – sdgfsdh
@sdgfsdh不完全是配置錯誤,但不能完全配置;) – VonC
對不起,你回答得這麼快,這是在時間限制內,然後我忘了!有一些業力:) – sdgfsdh