Eclipse Git (EGit) 无法克隆 Git 存储库
基本上,我找不到 EGit Clone Git Repository 对话框的可用 URI。
使用协议 git,就像我的命令行克隆操作一样,我尝试了各种 URI,但结果并不令人满意。有时,我无法单击“下一步”按钮:
git://af-blackpearl.site
git:af-blackpearl.site:myproject
在其他情况下,我会尝试(并且我可以单击“下一步”按钮):
git:af-blackpearl.site/myproject[.git] (with or without extension)
但是,我得到:
Cannot list the available branches.
Reason:
git:af-blackpearl.site/rest-server:ProxyHTTP: java.io.IOException:
proxy error: Service Unavailable
当我尝试时:
git://af-blackpearl.site/myproject[.git] (with or without extension)
git://af-blackpearl.site/
我总是得到类似的信息:
Cannot list the available branches.
Reason:
git://af-blackpearl.site/myproject: Connection refused
非常感谢您提出的任何后续建议在。
有用的背景
- 在 Linux 主机上使用 gitolite Git
- 远程
- 管理 Git我的“客户端”主机 Linux 正在运行 Eclipse Helios
- 一直通过命令行使用 Git;效果很好
这个问题专门关于使用 EGit(Eclipse 插件)对话框。与Git无关,使用Git甚至安装插件——所有这些看起来都不麻烦。简而言之,我长期以来一直通过命令行使用 Git,现在只是尝试使用 Eclipse-Git 集成。
在 /etc/hosts 中,我有一行:
xxx.xxx.xxx.xxx af-blackpearl.site
用于我们的本地 Git 远程存储库。虽然我通过 gitolite-admin 项目管理 Git,但我想要在 af-blackpearl.site 上克隆的项目的(物理、文件系统)路径是
/home/ git/repositories/myproject.git
从命令行,我习惯于从源头克隆它,从而获得一致的成功:
$ git clone git:af-blackpearl.site:myproject
尽管查看了 EGit(Google 托管的)文档并进行了大量的 Google 搜索,但我我有无法将此适应 EGit Clone Git Repository 对话框(因此达到):
File -> Import... -> Git -> Projects from Git -> Clone
连接到远程:
russ@russ-elite-book:~> ssh [email protected]
PTY allocation request failed on channel 0
hello russ, the gitolite version here is v2.0.1-2-g836faf9
the gitolite config gives you the following access:
R W NavigationServlet
R W gitolite-admin
R W ivysample
R W myproject
R W seam-catch
Connection to af-blackpearl.site closed.
Basically, I can't find a workable URI for the EGit Clone Git Repository dialog.
Using protocol git, just as from my command-line clone operation, I've tried various URIs with unsatisfactory results. Sometimes, I can't click the Next button:
git://af-blackpearl.site
git:af-blackpearl.site:myproject
In other cases, I try (and I can click the Next button):
git:af-blackpearl.site/myproject[.git] (with or without extension)
but, I get:
Cannot list the available branches.
Reason:
git:af-blackpearl.site/rest-server:ProxyHTTP: java.io.IOException:
proxy error: Service Unavailable
When I try:
git://af-blackpearl.site/myproject[.git] (with or without extension)
git://af-blackpearl.site/
I always get something like:
Cannot list the available branches.
Reason:
git://af-blackpearl.site/myproject: Connection refused
Many thanks for any suggestion to follow up on.
Useful Background
- Git administrated using gitolite
- Git remote(s) on Linux host
- My "client" host, Linux, is running Eclipse Helios
- Been using Git via command line; works great
This question is specifically about using the EGit (Eclipse plug-in) dialog. It is not about Git, using Git or even installing the plug-in--all of which do not seem troublesome. Simply, I've long been using Git from the command line and am just trying to use the Eclipse-Git integration now.
In /etc/hosts, I have a line:
xxx.xxx.xxx.xxx af-blackpearl.site
for our local Git remote repository. Though I administer Git via a gitolite-admin project, the (physical, filesystem) path to the project I'd like to clone on af-blackpearl.site is
/home/git/repositories/myproject.git
From the command line, I'm used to cloning it from origin thus with consistent success:
$ git clone git:af-blackpearl.site:myproject
Despite looking at the EGit (Google-hosted) documentation and much Googling, I'm having trouble adapting this to the EGit Clone Git Repository dialog (reached thus):
File -> Import... -> Git -> Projects from Git -> Clone
Connection to remote:
russ@russ-elite-book:~> ssh [email protected]
PTY allocation request failed on channel 0
hello russ, the gitolite version here is v2.0.1-2-g836faf9
the gitolite config gives you the following access:
R W NavigationServlet
R W gitolite-admin
R W ivysample
R W myproject
R W seam-catch
Connection to af-blackpearl.site closed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我也遇到了这个问题。但我找到了这里提出的解决方案: http://www.vogella.com/articles /EGit/article.html#clone_respository
简而言之,编写 URI: git@ yourhost.com:repository 而不是 git:// 这使得 eclipse 以用户 git 而不是你的身份连接用户名,但仍使用您的私钥。
我没有设置任何协议,正如文章中没有设置的那样。
编辑:现在我实际上发现“J-16 SDiZ”发布了完全相同的答案。虽然我当时没明白。
I too had problems with this. But I found a solution presented here: http://www.vogella.com/articles/EGit/article.html#clone_respository
In short, write URI: git@ yourhost.com:repository instead of git:// This makes eclipse connect as user git instead of your username, but still use your private key.
I did not set any protocol, just as the article does not.
EDIT: Now I actually found that "J-16 SDiZ" posted quite the same answer. Although I didn't get it at that time.
如果您使用的是 SSH 协议(我看到您使用“ssh [email protected]"),你应该选择协议中的“ssh”。存储库名称是 myproject (没有
.git
部分)If you are using the SSH protocol (I saw you use "ssh [email protected]"), you should choose "ssh" in protocol. The repository name is myproject (no
.git
part)我在通过 EGit 对话框连接到远程 git 存储库时遇到了与您描述的相同的问题。
我最终所做的仍然是使用命令行 git 工具来克隆存储库和其他内容,然后将存储库作为本地存储库导入到 Eclipse 中。据我所知,这使得 EGits 的所有功能都能完美运行,并且我使用 Eclipse 来添加、提交、推送和更改分支,并且一切都完美运行。
我仍然使用命令行工具来完成很多任务,恕我直言,这给了我两全其美的好处。但最初,我无法让 EGit 直接克隆远程存储库,这让我很烦恼。
我知道这不是对您的问题的直接答案,但是带有 EGit 的 Eclipse 功能齐全,无需从 EGit 内远程克隆。
I had the same problems you describe connecting to remote git repositories through the EGit dialogs.
What I've ended up doing is still using the command line git tools to clone repos and stuff, and then import the repos into Eclipse as local repos. As far as I can tell that makes all of EGits functionality working perfectly, and I've used Eclipse to add, commit, push and change branches and all worked flawlessly.
I still use the command line tools for a lot of tasks, and this gives me the best of both worlds IMHO. But initially it bugged the hell out of me that I could not get EGit to clone remote repositories directly.
I know it's not a direct answer to your question, but Eclipse with EGit is fully functional without cloning remotely from within EGit.
您可能想尝试使用 git 存储库的完整服务器路径。
我正在使用 git 实施我的第一个项目。我正在使用我的共享 Linux 托管计划 (1and1) 提供的 git 服务。
经过大量的试验和错误,如果我使用完整的服务器路径,我似乎能够找到 git 存储库。
就我而言:
我的 git 存储库是在 /project 创建的
似乎让我找到 git 存储库的唯一路径是:
/homepages/foo/bar/htdocs/project/.git <- 这是 1and1 处的完整服务器路径。
我正在使用 SSH 协议。
我必须使用完整路径是没有意义的,因为当我 ssh 到我的帐户时,我会到达我的帐户主页。但我尝试过的任何其他组合都不起作用。
如果您想了解我用于访问共享主机中的 git 存储库的确切配置,请检查此问题 -> 克隆 1and1 git 存储库时出现问题1and1 使用 Eclipse EGit 共享 Linux 服务器
祝你好运!
You may want to try using the full server path to your git repository.
I am in the process of implementing my first project using git. I am using the git service offered by my shared Linux hosting plan (1and1).
After a lot of trial and error I seem to be able to find the git repository if I use the full server path to it.
In my case:
My git repository was created at /project
The only path that seems to let me find the git repository is:
/homepages/foo/bar/htdocs/project/.git <- this is the full server path at 1and1.
I am using the SSH protocol.
It doesn't make sense that I have to use the full path because when I ssh to my account I get to my account home. But any other combination I tried doesn't work.
If you are curious to see the exact configuration I used to access my git repository in my shared host, check this question -> Problems cloning 1and1 git repository in 1and1 shared Linux server with Eclipse EGit
Good luck!
我遇到了同样的问题,我检查了 SSH2 的 eclipse 配置,发现它正确指向“~/.ssh”
问题是我那里没有任何密钥(id_rsa & id_rsa.pub)
我添加了它们,再次尝试,我成功拉取了我的 github 存储库。
I had the same problem, I checked the eclipse configuration of SSH2 and found it correctly points to the "~/.ssh"
The problem was that I did not have any keys there (id_rsa & id_rsa.pub)
I added them, tried again, I pulled successfully my github repo.