简体   繁体   English

Eclipse EGIT:当前分支未配置为pull

[英]Eclipse EGIT: Current branch not configred for pull

I am working on a tilebased RPG with a friend of mine who has to go away for weeks and we decided it was time to use version control/git. 我和我的一个朋友正在制作一个基于平铺的角色扮演游戏,他必须离开几周,我们决定是时候使用版本控制/ git了。 I am starting to regret that. 我开始后悔了。 After a few hours we managed to get it working to the point where: 几个小时后,我们设法使其工作到以下地步:

  1. I create a repository on github, add him as collaborator. 我在github上创建了一个存储库,将他添加为协作者。
  2. I commit project in eclipse to git, push 我在eclipse中将项目提交给git,push
  3. He pulls, gets it imported in his workspace 他拉,把它导入他的工作区
  4. I make some changes, commit push, he pulls the changes. 我做了一些改变,提交推动,他拉动了变化。
  5. He makes some changes, commits and pushes successfully. 他做了一些改变,提交和推动成功。 Changes appear in repo 回购中出现变化
  6. I try to pull changes, get errors (see image), unsuccessful. 我试图拉变化,得到错误(见图),不成功。
  7. I make some changes, try to commit, get errors, unsuccessful. 我做了一些更改,尝试提交,获取错误,不成功。

Essentially we are locked with a project he can update and I cannot. 基本上我们锁定了他可以更新的项目,我不能。 I am the repo owner if that matters at all. 如果重要的话,我就是回购所有人。

On trying to "Fetch from upstream": 试图“从上游获取”: “1”

On trying to "Pull": 试图“拉”: “2”

On commit&push: 在提交和推送: “3”

We are pretty much stuck now. 我们现在几乎被困住了。 We rather not use skype to send files, at some point we are going to be professionals and that seems too tedious. 我们宁愿不使用Skype来发送文件,在某些时候我们将成为专业人士,这似乎太乏味了。

As requested: 按照要求: 在此输入图像描述

The error message "This branch is not configured for pull" in EGit is typical of a branch created locally and pushed. EGit中的错误消息“此分支未配置为拉”是典型的本地创建并推送的分支。

That wouldn't set the merge section of that branch. 那不会设置该分支的合并部分。
See " The current branch is not configured for pull No value for key branch.master.merge found in configuration " 请参阅“ 当前分支未配置为拉取配置中找到的关键branch.master.merge没有值

[branch "master"]
  remote = origin
  merge = refs/heads/master

To solve that, one way is to rename your current master branch, and, in the Git Repositories view: 要解决这个问题,一种方法是重命名当前的master分支,并在Git Repositories视图中:

  • Right-click on " Branches " / " Switch to " / " New Branch " 右键单击“ Branches ”/“ Switch to ”/“ New Branch
  • pull down " Source ref " list, select " master " branch ( pull strategy " merge ", " Checkout new branch " checked) 下拉“ Source ref ”列表,选择“ master ”分支( pull strategymerge ”,“ Checkout new branch ”选中)
  • click " finish " 点击“ finish

The new branch should be correctly configured 应正确配置新分支

This worked for me in Eclipse IDE with EGit: 这在Eclipse IDE中使用EGit对我有用:

Open Window->Show view->Other->Git->Git Repositories
    Right click on your repo in Git Repositories view -> Properties
    Click "Add Entry..." button
    key: branch.master.remote
    value: origin
    OK
    Click "Add Entry..." button
    key: branch.master.merge
    value: refs/heads/master
    OK
    Right click on your repo -> Pull

Btw. 顺便说一句。 I'm pulling master from remote and my local branch when pulling is also master. 当拉动也是主人时,我从远程和我的本地分支拉主人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM