EGit:不能推,不能拉 [英] EGit: cannot push, cannot pull

查看:204
本文介绍了EGit:不能推,不能拉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用EGit,并且对我的本地git存储库进行了更改。

I'am using EGit and I commited a change to my local git repository.

我想将此更改推送到远程。
当这样做时,会弹出一个对话框,其中显示了rejected-master-主非快进。这个链接的问题的答案表明我必须先拉动。

I'd like to push this change to a remote. When doing that, a dialog screen pops up which shows "rejected-master-master-non-fast-forward". The answer of this linked question states that I have to pull first.

在拉动时,抛出一个EGit异常:

When doing the pull, an EGit exception is thrown:

org.eclipse.jgit.api.errors.TransportException: Nothing to fetch.
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
    at org.eclipse.jgit.api.PullCommand.call(PullCommand.java:253)
    at org.eclipse.egit.core.op.PullOperation$1.run(PullOperation.java:97)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.egit.core.op.PullOperation.execute(PullOperation.java:128)
    at org.eclipse.egit.ui.internal.pull.PullOperationUI.execute(PullOperationUI.java:139)
    at org.eclipse.egit.ui.internal.pull.PullOperationUI$1.runInWorkspace(PullOperationUI.java:114)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.jgit.errors.TransportException: Nothing to fetch.
    at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1087)
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
    ... 8 more

似乎我被卡住了。谁可以帮助我?



更新

我的存储库中的 .git / config 文件包含(远程URL隐藏):

The .git/config file in my repository contains (remote URL hid):

[core]
  repositoryformatversion = 0
  filemode = true
  bare = false
  logallrefupdates = true
  ignorecase = true
[branch "master"]
  remote = origin
  merge = refs/heads/master
[remote "origin"]
    url = <URL_HIDDEN>

我正在使用 Eclipse Git Team Provider 3.4.1.201406201815

推荐答案

存储库的配置似乎错过了 [remoteorigin ] section:

The configuration of the repository seems to miss this line in the [remote "origin"] section:

fetch = + refs / heads / *:refs / remotes / origin / *

fetch = +refs/heads/*:refs/remotes/origin/*

它告诉git以 refs / heads / (所有分支)并将它们存储在本地的 refs / remotes / origin / 下。例如。远程存储库中的 refs / heads / master 将成为 refs / remotes / origin / master 本地(或 origin / master 简而言之。)

It tells git to fetch all refs starting with refs/heads/ (all branches) and store them under refs/remotes/origin/ locally. E.g. the refs/heads/master in the remote repository will become refs/remotes/origin/master locally (or origin/master in short).

你可以添加它,并尝试,如果它使拉工作?

Can you add that and try if it makes pull work?

此外,知道您最初创建/克隆此存储库的方式非常有趣。

Also, it would be very interesting to know in which way you first created/cloned this repository.

这篇关于EGit:不能推,不能拉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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