克隆或推送git存储库时,无法在Eclipse中打开git-upload-pack错误 [英] 'cannot open git-upload-pack' error in Eclipse when cloning or pushing git repository

查看:4255
本文介绍了克隆或推送git存储库时,无法在Eclipse中打开git-upload-pack错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法克隆或推送到位于Bitbucket的git仓库:

I am not able to clone or push to a git repository at Bitbucket in Eclipse:

这很奇怪,因为前一天我没有任何问题。我已经下载了sts 3次,没有运气。此错误不断显示。另外我已经安装了SourceTree,它说'这不是有效的源路径/ URL':

It's weird, because a day before I didn't have any problem. I have downloaded the sts 3 times with no luck. This error keeps showing. Also I have installed SourceTree and it says 'This is not a valid source path / URL':

如果我使用git命令导入项目,它的作品,但我不会使用EGit这个任务,因为我是一个新手与git。

If I use git commands to import the project, it works, but I wan't to use EGit for this task, since I am a newbie with git.

我不知道这是否与它有关,但在同一个目录中,我有android-adt-bundle。这个工程很好,但这个项目在于GitHub而不是Bitbucket。此外,我正在与另一个人合作,他能够从Bitbucket存储库获取数据并将数据推送到Bitbucket存储库。我读了很多帖子,但没有一个帮助我。

I don't know if this has to do with it, but in the same directory I have the android-adt-bundle. This one works pretty well, but the project lies on GitHub and not Bitbucket. Also, I'm working with another person and he is able to fetch and push data from and to the Bitbucket repository. I have read lots of posts but none of them have helped me out.

我正在使用Windows 7 btw。

I'm using Windows 7 btw.

推荐答案

由于步骤概述在Eclipse论坛中:


  1. 根据 http://help.github。上的github说明下载并安装mysys git。 com / win-git-installation /

  2. 在C:/ Users / you / ssh中隐藏子目录中的现有密钥(id_rsa和id_rsa.pub)。如果ssh目录不存在,请创建它。当然,你是操作系统知道你的用户名。

  3. 从开始菜单中运行Git-Bash命令shell(一个常规的DOS命令shell将不起作用) li>
  4. 在Git-Bash shell中,根据您的电子邮件(您在github注册的)生成一个rsa密钥:
    ssh-keygen -t rsa -Cyou@wherever.com
    并输入您的密码并确认询问。

  5. 上一步应该创建C:/User/you/ssh/id_rsa.pub,您现在可以打开一个文本编辑器和副本。在github,转到帐户设置,SSH密钥,添加一个密钥并将其粘贴到密钥框中。

  6. 再次在Git-Bash中(注意下一行的后面的勾号):

    eval`ssh-agent`
    ssh-add C:/ User / you / ssh / id_rsa
    ssh git@github.com

  1. Download and install mysys git according to the github instructions at http://help.github.com/win-git-installation/
  2. In C:/Users/you/ssh hide any existing keys (id_rsa and id_rsa.pub) in a subdirectory. If the ssh directory does not exist, create it. Of course, "you" is your username as the OS knows you.
  3. From the start menu, run Git-Bash command shell (a regular DOS command shell will not work).
  4. In the Git-Bash shell generate an rsa key based on your email (the one you registered at github): ssh-keygen -t rsa -C "you@wherever.com" and enter your pass phrase and confirm when asked.
  5. The previous step should have created C:/User/you/ssh/id_rsa.pub which you can now open in a text editor and copy. At github, go to account settings, SSH Keys, add a key and paste this in the key box.
  6. In Git-Bash again (notice the back-ticks in the next line): eval `ssh-agent` ssh-add C:/User/you/ssh/id_rsa ssh git@github.com

这是你刚刚做的:你运行ssh-agent需要ssh-加。然后你使用ssh-add来记录你的密钥的位置。然后你试图ssh到GitHub。对最后一个命令的响应应该是您已经在GitHub上成功进行身份验证,但是没有shell访问。这只是一个认证测试。如果身份验证不成功,您必须将其排除。尝试详细版本:

Here is what you just did: You ran the ssh-agent which is needed by ssh-add. Then you used ssh-add to make note of the location of your key. Then you tried to ssh to GitHub. The response to this last command should be that you have successfully authenticated at GitHub but that you don't have shell access. This is just an authentication test. If the authentication was not successful, you'll have to sort that out. Try the verbose version:

ssh -v git@github.com

假设这样工作....

Assuming this worked....


  1. 窗口> 显示视图> Git > Git存储库将添加存储库资源管理器窗口。

  2. 在存储库窗口中,选择存储库并展开并右键单击远程,然后选择创建远程

  3. 从GitHub存储库页面复制GitHub存储库URI,并将其粘贴到URI框中。

  4. 选择ssh作为协议,返回到URI框,并在开头添加git +,看起来像这样:

  1. Window > Show View > Git > Git Repositories will add a repository explorer window.
  2. In the repository window, select the repository and expand and right-click Remotes and choose Create Remote.
  3. Copy the GitHub repository URI from the GitHub repository page and paste it in the URI box.
  4. Select ssh as the protocol but then go back to the URI box and add "git+" at the beginning so it looks like this:

git + ssh://git@github.com/UserName/ProjectName .git

git+ssh://git@github.com/UserName/ProjectName.git

存储库路径框中,删除前导斜杠

而不是使用SSH git@github.com,我用SSH git@bitbucket.org。

Instead of using SSH git@github.com I did it with SSH git@bitbucket.org.

现在我可以推送和导入没有任何问题。

Now I can push and import without any problem.

这篇关于克隆或推送git存储库时,无法在Eclipse中打开git-upload-pack错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆