Eclipse Git (EGit) 无法克隆 Git 存储库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6996983/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse Git (EGit) unable to clone Git repository
提问by Russ Bateman
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. Sometimes, I can't click the Next button:
使用协议 git,就像从我的命令行克隆操作一样,我尝试了各种 URI,但结果并不令人满意。有时,我无法单击“下一步”按钮:
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
- 使用gitolite管理 Git
- Linux 主机上的 Git 远程
- 我的“客户端”主机 Linux 正在运行 Eclipse Helios
- 一直通过命令行使用 Git;效果很好
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.
这个问题是专门关于使用 EGit(Eclipse 插件)对话框的。不是关于Git,使用Git甚至安装插件——所有这些看起来都不麻烦。简而言之,我长期以来一直在命令行中使用 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. Though I administer Git via a gitolite-adminproject, the (physical, filesystem) path to the project I'd like to clone on af-blackpearl.site is
用于我们本地的 Git 远程存储库。虽然我通过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 托管)文档和大量谷歌搜索,但我无法将其适应 EGit Clone Git Repository 对话框(因此达到):
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.
采纳答案by J-16 SDiZ
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)
如果您使用的是 SSH 协议(我看到您使用“ssh [email protected]”),您应该在协议中选择“ssh”。存储库名称是 myproject(无.git
部分)
回答by Matteus Magnusson
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. Although I didn't get it at that time.
编辑:现在我实际上发现“J-16 SDiZ”发布了完全相同的答案。虽然当时我没有得到。
回答by thomasmalt
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. 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.
我最终做的仍然是使用命令行 git 工具来克隆 repos 和其他东西,然后将 repos 作为本地 repos 导入到 Eclipse 中。据我所知,这使得所有 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 中远程克隆。
回答by jdias
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. I am using the git service offered by my shared Linux hosting plan (1and1).
我正在使用 git 实施我的第一个项目。我正在使用我的共享 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. But any other combination I tried doesn't work.
我必须使用完整路径是没有意义的,因为当我 ssh 到我的帐户时,我会到达我的帐户主页。但是我尝试过的任何其他组合都不起作用。
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 服务器中克隆 1and1 git 存储库的问题
Good luck!
祝你好运!
回答by Montaro
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 仓库。