[英]Egit error connecting to remote repo
Im having some difficulties connecting my project in eclipse with my remote repo with EGit.我在 eclipse 中将我的项目与我的远程仓库与 EGit 连接起来时遇到了一些困难。 I have already created a local git repo and now I want to connect it to github, but when I add the URI and use a https protocol I get:
我已经创建了一个本地 git repo,现在我想将它连接到 github,但是当我添加 URI 并使用 https 协议时,我得到:
"Internal error; consult Eclipse error log."
And I get this message in the Eclipse error log:我在 Eclipse 错误日志中收到此消息:
Error validating org.eclipse.egit.ui.internal.components.RepositorySelectionPage
How can I fix this?我怎样才能解决这个问题?
What I do is that I go to remotes, right click it and select "Create remote...".我要做的是转到遥控器,右键单击它并选择“创建遥控器...”。 I then change the URI, and I add " https://github.com/Lumberfella/angularApp.git " to the URI input box, and the Host and Repository path auto fills themselves to:
然后我更改 URI,并将“ https://github.com/Lumberfella/angularApp.git ”添加到 URI 输入框,主机和存储库路径自动填充为:
Host: github.com
Repository path: /Lumberfella/angularApp.git
and In the connection section I have https as the Protocol.在连接部分,我将 https 作为协议。
When I do this, its already giving me an error at the top of the "Select URI" window saying: "internal error; consult Eclipse error log."当我这样做时,它已经在“选择 URI”窗口的顶部给我一个错误,说:“内部错误;请查阅 Eclipse 错误日志。” which is what I posted above.
这是我在上面发布的内容。
Im using EGit version 3.3.1我使用 EGit 版本 3.3.1
I tried out you repository, and it seemed that repository is empty.我尝试了你的存储库,看起来存储库是空的。 I am not entirely sure about this answer, but I believe, you cannot use the read-only http urls on empty repositories (eg they have no branches to pull).
我对这个答案并不完全确定,但我相信,您不能在空存储库上使用只读 http url(例如,它们没有要拉的分支)。
This theory is further supported by the exception trace I have found in the Error log view:我在错误日志视图中发现的异常跟踪进一步支持了这一理论:
Caused by: org.eclipse.jgit.api.errors.InvalidRemoteException: Invalid remote: test
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:136)
at org.eclipse.egit.core.op.FetchOperation.run(FetchOperation.java:127)
at org.eclipse.egit.ui.internal.fetch.FetchOperationUI.execute(FetchOperationUI.java:100)
... 64 more
Caused by: org.eclipse.jgit.errors.NoRemoteRepositoryException: test: not found.
at org.eclipse.jgit.transport.TransportLocal$1.open(TransportLocal.java:131)
at org.eclipse.jgit.transport.TransportBundleFile$1.open(TransportBundleFile.java:106)
at org.eclipse.jgit.transport.Transport.open(Transport.java:556)
at org.eclipse.jgit.transport.Transport.open(Transport.java:316)
at org.eclipse.jgit.transport.Transport.open(Transport.java:287)
at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:120)
... 66 more
Basically, the trace says, it cannot get contents from the remote repository.基本上,跟踪说,它无法从远程存储库中获取内容。
I was not able to make it work by adding a remote repository by adding the https or ssh inside eclipse in remotes.我无法通过在 eclipse 中添加 https 或 ssh 来添加远程存储库来使其工作。
But since I was able to make a working local repository, I figured all I needed to do was download the Git Shell and add a new remote repository that way.但是由于我能够创建一个有效的本地存储库,我认为我需要做的就是下载 Git Shell 并以这种方式添加一个新的远程存储库。
For some reason this totally worked and it also automaticly connected the remote repository to eclipse, so Im now able to push directly from eclipse to both the local and the remote repository (or which ever I would like to).出于某种原因,这完全有效,它还自动将远程存储库连接到 eclipse,所以我现在可以直接从 eclipse 推送到本地和远程存储库(或者我想要的任何一个)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.