简体   繁体   English

Eclipse Git(EGit)无法克隆Git存储库

[英]Eclipse Git (EGit) unable to clone Git repository

Basically, I can't find a workable URI for the EGit Clone Git Repository dialog. 基本上,我找不到EGit Clone Git Repository对话框的可行URI。

一次尝试

Using protocol git, just as from my command-line clone operation, I've tried various URIs with unsatisfactory results. 使用协议git,就像我的命令行克隆操作一样,我尝试了各种不满意的URI结果。 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使用gitolite进行管理
  • Git remote(s) on Linux host 在Linux主机上使用Git remote
  • My "client" host, Linux, is running Eclipse Helios 我的“客户端”主机Linux正在运行Eclipse Helios
  • Been using Git via command line; 通过命令行使用Git; works great 效果很好

This question is specifically about using the EGit (Eclipse plug-in) dialog. 这个问题具体是关于使用EGit(Eclipse插件)对话框。 It is not about Git, using Git or even installing the plug-in--all of which do not seem troublesome. 这不是关于Git,使用Git甚至安装插件 - 所有这些似乎都不麻烦。 Simply, I've long been using Git from the command line and am just trying to use the Eclipse-Git integration now. 简单地说,我一直在命令行中使用Git,现在只是尝试使用Eclipse-Git集成。

In /etc/hosts , I have a line: / etc / hosts中 ,我有一行:

xxx.xxx.xxx.xxx   af-blackpearl.site

for our local Git remote repository. 为我们的本地Git远程存储库。 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 虽然我通过gitolite-admin项目管理Git,但我希望在af-blackpearl.site上克隆的项目的(物理,文件系统)路径是

/home/git/repositories/myproject.git /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): 尽管查看了EGit(Google托管的)文档和Google Googling,但我无法将其应用于EGit Clone Git Repository对话框(因此达到了这个目标):

File -> Import... -> Git -> Projects from Git -> Clone

Connection to remote: 连接到远程:

russ@russ-elite-book:~> ssh git@af-blackpearl.site
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.

I too had problems with this. 我也有这个问题。 But I found a solution presented here: http://www.vogella.com/articles/EGit/article.html#clone_respository 但是我在这里找到了一个解决方案: 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. 简而言之,写URI: git @ yourhost.com:repository而不是git://这使得eclipse以用户git而不是用户名连接,但仍然使用你的私钥。

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. 编辑:现在我发现“J-16 SDiZ”发布了相同的答案。 Although I didn't get it at that time. 虽然我当时没有得到它。

If you are using the SSH protocol (I saw you use "ssh git@af-blackpearl.site"), you should choose "ssh" in protocol. 如果您使用SSH协议(我看到您使用“ssh git@af-blackpearl.site”),您应该在协议中选择“ssh”。 The repository name is myproject (no .git part) 存储库名称是myproject(没有.git部分)

I had the same problem, I checked the eclipse configuration of SSH2 and found it correctly points to the "~/.ssh" 我有同样的问题,我检查了SSH2的eclipse配置,发现它正确指向“〜/ .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. 问题是我没有任何键(id_rsa和id_rsa.pub)我添加了它们,再次尝试,我成功地拉了我的github回购。

I had the same problems you describe connecting to remote git repositories through the EGit dialogs. 我有同样的问题,你描述通过EGit对话框连接到远程git存储库。

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. 我最终做的仍然是使用命令行git工具克隆repos和stuff,然后将repos作为本地存储库导入Eclipse。 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. 据我所知,这使得所有EGits功能都能正常运行,而且我已经使用Eclipse来添加,提交,推送和更改分支,并且所有功能都完美无缺。

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. 但最初它让我感到害怕,我无法让EGit直接克隆远程存储库。

I know it's not a direct answer to your question, but Eclipse with EGit is fully functional without cloning remotely from within EGit. 我知道这不是你问题的直接答案,但带有EGit的Eclipse功能齐全,无需从EGit中远程克隆。

You may want to try using the full server path to your git repository. 您可能想尝试使用git存储库的完整服务器路径。

I am in the process of implementing my first project using git. 我正在使用git实现我的第一个项目。 I am using the git service offered by my shared Linux hosting plan (1and1). 我正在使用我的共享Linux主机方案(1and1)提供的git服务。

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. 经过大量的试验和错误,我似乎能够找到git存储库,如果我使用它的完整服务器路径。

In my case: 就我而言:

My git repository was created at /project 我的git存储库是在/ project创建的

The only path that seems to let me find the git repository is: 似乎让我找到git存储库的唯一途径是:

/homepages/foo/bar/htdocs/project/.git <- this is the full server path at 1and1. /homepages/foo/bar/htdocs/project/.git < - 这是1and1的完整服务器路径。

I am using the SSH protocol. 我正在使用SSH协议。

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. 我必须使用完整路径是没有意义的,因为当我ssh到我的帐户时,我会到我的帐户回家。 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 如果您想要查看我在共享主机中访问我的git存储库的确切配置,请检查此问题 - > 使用Eclipse EGit克隆1and1共享Linux服务器中的1和1 git存储库

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM