无法通过SSH从Eclipse连接GIT

时间:2018-04-11 20:26:18

标签: eclipse git ssh

我正在尝试从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.

请让我解决这个问题。

1 个答案:

答案 0 :(得分:0)

如果您要连接到“localhost”,那么您不需要ssh 使用该文件或“local protocol

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