无法从 Eclipse 通过 SSH 连接 GIT



我正在尝试从 eclipse 连接 GIT 存储库。如果我使用 GIT 协议,那么我可以拉取文件。但是当我尝试通过 ssh 协议连接时,我遇到了以下问题。

org.eclipse.jgit.api.errors.TransportException: ssh://username@localhost:8001/Repo: verify: false
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:223)
    at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:161)
    at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:114)
    at org.eclipse.egit.ui.internal.clone.SourceBranchPage$8.run(SourceBranchPage.java:335)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://username@localhost:8001/Repo: verify: false
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:172)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170)
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:200)
Caused by: com.jcraft.jsch.JSchException: verify: false
    at com.jcraft.jsch.Session.connect(Session.java:330)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:126)
I tried adding http.sslverify=false in Git Configuration, adding .git at the end of the URL. But still the issue is not resolved.

请让我解决问题。

如果你连接到"localhost",那么你不需要ssh。
使用文件或"本地协议">

cd /path/to/my/repo
git remote set-url origin /home/username/Repo.git

最新更新