【问题标题】:Eclipse egit Error when trying to fetch or pushEclipse egit 尝试获取或推送时出错
【发布时间】:2014-05-14 11:41:15
【问题描述】:

我已将一些存储库从 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

直到大约 10 天前,通过 egit 获取和推送确实有效。

从 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) 进行了尝试。

有什么建议吗?

【问题讨论】:

    标签: linux eclipse git github egit


    【解决方案1】:

    这可能是凭据问题,如“An internal Exception occurred during push: cannot store objects”中所述:

    我刚刚重新配置了eclipse,添加了我的github账号信息并保存了。
    然后它起作用了。

    Team->Remote->Configure push to upstream->URI, Change->Add authentication details
    

    另一个经典问题是 url 中的大写问题(“git-upload-pack not found”),但如果它是从命令行工作的,这里就不应该出现这种情况。

    【讨论】:

    • 我认为Team→Remove应该是Team→Remote
    • 我用全新安装的 Eclipse 4.3 SR2 进行了尝试,但没有成功。仍然是相同的错误消息。
    • @Joe 好的。我已经修正了错字
    【解决方案2】:

    好的,看来我遇到了.git 后缀问题。

    解决方案:我必须在 URI 中添加 .git

    就像 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 月中旬这才成为问题。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-27
      • 1970-01-01
      • 1970-01-01
      • 2016-03-18
      • 1970-01-01
      • 2012-04-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多