eclipse EGIT 拒绝非快进

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15262582/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 20:06:42  来源:igfitidea点击:

EGIT rejected non-fast forward

eclipseegit

提问by mike

I'm on Eclipse 4.2.1 (Java) and trying to use EGIT. My account is all set up on Github. No one else is working on it so there are no changes. I have a very simply project containing a single file with one print statement. I created my local repo and added the project. (project explorer shows: [gitrepo1 master])

我在 Eclipse 4.2.1 (Java) 上并尝试使用 EGIT。我的帐户全部设置在 Github 上。没有其他人正在处理它,因此没有任何更改。我有一个非常简单的项目,其中包含一个带有一个打印语句的文件。我创建了我的本地存储库并添加了该项目。(项目浏览器显示:[gitrepo1 master])

In project explorer: right click on project -> team -> remote -> push But I get: master: HEAD [rejected - non-fast-forward]

在项目资源管理器中:右键单击项目 -> 团队 -> 远程 -> 推送但我得到:master: HEAD [rejected - non-fast-forward]

I've configured the push: Branch -> master URI -> ssh.git@github.... Ref mappings -> HEAD:/refs/heads/master

我已经配置了推送:Branch -> master URI -> ssh.git@github.... Ref mappings -> HEAD:/refs/heads/master

What am I doing wrong?

我究竟做错了什么?

采纳答案by mike

Got it now, not sure what I did wrong. I just started over again following this video: http://www.youtube.com/watch?v=U1kXlahkwd4

现在明白了,不知道我做错了什么。我刚刚按照这个视频重新开始:http: //www.youtube.com/watch?v=U1kXlahkwd4

回答by Bernát

We had this problem, because we amended a commit after pushing it.

我们遇到了这个问题,因为我们在推送之后修改了提交。

The solution was to merge origin/master (in Branches > Remote tracking), then push.

解决方案是合并 origin/master(在分支 > 远程跟踪中),然后推送。

回答by ams

egit works by using jgit which is an implementation of git that is using java. the best thing to do is verify that the repo works with the normal git client. From your question it is not possible to know exactly how things ore configured.

egit 使用 jgit 工作,jgit 是使用 java 的 git 实现。最好的办法是验证 repo 是否适用于普通的 git 客户端。从您的问题中,不可能确切地知道事物是如何配置的。

When you get the error message that you could not do a push because it is not a fast forward, it means you need to do a pull first then, do the push, so try that.

当您收到由于不是快进而无法进行推送的错误消息时,这意味着您需要先进行拉动,然后再进行推送,因此请尝试。

回答by Bruno Eberhard

Same cause as Bernát: I amended a commit after pushing it. Merge failed because of conflicts.

与 Bernát 相同的原因:我在推送后修改了提交。由于冲突,合并失败。

My way out: Context menu 'Team/Reset' selection 'Remote Tracking'/'origin master' option 'Mixed'. After that all my changes since last push were marked and I could commit and push.

我的出路:上下文菜单“团队/重置”选择“远程跟踪”/“原点主”选项“混合”。之后,我自上次推送以来的所有更改都被标记,我可以提交和推送。