我从github克隆了一些存储库到我的本地机器(linux x86 32位kubuntu 12.04)。 一般来说,我从命令行克隆,然后使用git透视和连接到eclipse “将现有的本地git存储库添加到此视图”。 之后,我可以导入项目(来自工作目录),执行提交等等。
但是当我尝试获取或推送远程存储库时,我收到了一些不同的错误消息。
尝试提取时,收到错误消息:Invalid remote: origin
当我尝试推动时,我得到的结果是:https://github.com/Joe-Merten/Playground: https://github.com/Joe-Merten/Playground/info/refs?service=git-receive-pack not found
通过egit获取并推送确定已经工作到大约10天前。
从linux命令行获取和推送仍然没有问题。
当尝试使用eclipse egit进行克隆时,我也遇到了错误:https://github.com/…/refs?service=git-receive-pack not found
我在一些不同的linux机器上尝试使用eclipse 4.2 SR2(Juno)和4.3 SR2(Kepler)以及4.4-M6(Luna Prerelease)。
有什么建议吗?
答案 0 :(得分:2)
这可能是凭据问题,如" An internal Exception occurred during push: cannot store objects"中所述:
我只是重新配置了eclipse并添加了我的github帐户信息并存储它 然后它奏效了。
Team->Remote->Configure push to upstream->URI, Change->Add authentication details
另一个经典问题是网址中的大小写问题(" git-upload-pack not found"),但是如果它是从命令行工作的话,这不应该是这里的情况
答案 1 :(得分:0)
好吧,我似乎遇到了.git
后缀问题。
解决方案:我必须将.git
添加到URI。
就像Lars Vogel在nice article here中所写的那样:Copy the URL from Github and …
,
我刚刚使用该URI而未添加.git
后缀。
所以,我执行了克隆:
$ git clone https://github.com/Joe-Merten/Playground
并将我的克隆配置为具有以下遥控器:
$ git --git-dir=Playground/.git remote -v
origin https://github.com/Joe-Merten/Playground (fetch)
origin https://github.com/Joe-Merten/Playground (push)
这种方式会导致所描述的错误消息。
但是当我将.git
后缀添加到URI时:
$ git clone https://github.com/Joe-Merten/Playground.git
我的遥控器也会有.git后缀
$ git --git-dir=Playground/.git remote -v
origin https://github.com/Joe-Merten/Playground.git (fetch)
origin https://github.com/Joe-Merten/Playground.git (push)
使用这种方式,egit按预期工作。
只要我从命令行使用git,看起来(有或没有.git后缀)并不重要。 但是当使用egit作为前端时,这显然很重要。
<嗯,嗯,想知道为什么直到2014年3月中旬才出现问题。)