EGit: cannot push, cannot pull

浪子不回头ぞ 提交于 2019-11-28 21:36:46

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

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

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.

I also faced the same problem when using egit and could not pull the changes. But previous answer helped a lot. Now, there can be two ways to update the config file.

  1. Direct Update in the file : Goto local_repo_location/.git/ and open config file and add :

    [remote "origin"]

    url = YOUR_REPO_URL

    push = ALREADY_FILLED_VALUE

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

  2. Updating config using eclipse : Goto Windows -> Preferences -> Team -> Git -> Configuration and now under Repository Settings tab look under -> remote -> origin. Problem is there is no key for fetch. Now click : Add Entry and provide the values as follows :

Key : remote.origin.fetch

Value : +refs/heads/:refs/remotes/origin/

Now we are done.

Apurva Khune

i had the same problem pulling from remote repo was giving error (org.eclipse.jgit.api.errors.transportexception)

here's what i did

  1. changed the origin to my fork account and pulled.
  2. changed the origin back to the actual value and pulled.

donot really know about the problem of egit but this two simple steps solved my problem, hope it helps

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!