Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Help: My Push was rejected(Proceedure on how to resolve file conflicts and push files to remote file server)
Help: My Push was rejected [message #896312] Wed, 18 July 2012 02:34 Go to next message
Jaxim Flash is currently offline Jaxim FlashFriend
Messages: 8
Registered: June 2011
Junior Member
I am attempting to push some committed changes, but it's getting rejected with the following message:

master:master [rejected - non-fast-forward]

I synchronized and discover that a few remote files conflict with some of my committed local files. So I attempt to accept the remote file by performing any of the following actions: "Overwrite", "Merge", "Marked as Merged". However, none of those actions seems to do anything. The files still show up as being in conflict.

I also attempted to perform a "pull", but that too also produces an error. Within the Pull window, the "fetch result" states "No ref to fetch from origin - everything up to date". The "Update Result" states "Failed".


I am obviously a relatively new user to git and egit, so I would appreciate any help in what I should do to resolve the conflicts so I can upload my changes.

thanks!

Jack


[Updated on: Wed, 18 July 2012 02:45]

Report message to a moderator

Re: Help: My Push was rejected [message #896431 is a reply to message #896312] Wed, 18 July 2012 11:44 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
This is a general Git question, not EGit per se. You should have a look at Scott Chacon's book:http://git-scm.com/book/

The short answer is: pull, resolve conflicts, commit, push again.
Re: Help: My Push was rejected [message #896447 is a reply to message #896431] Wed, 18 July 2012 12:18 Go to previous messageGo to next message
Jaxim Flash is currently offline Jaxim FlashFriend
Messages: 8
Registered: June 2011
Junior Member
I've tried that. I tried to pull, but it told me it "Failed". I tried to resolve conflicts by Overwriting, but nothing happens.
Re: Help: My Push was rejected [message #896468 is a reply to message #896447] Wed, 18 July 2012 13:18 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
I recommend you avoid doing any operations in the synchronization view in egit. It's ok for comparing the current state of you active branch against some other branch or reference, but for day-to-day development you never need the synchronization view as you would in CVS or SVN. Forget whatever patterns you were using before, Git is fundamentally different.
Re: Help: My Push was rejected [message #896490 is a reply to message #896468] Wed, 18 July 2012 14:03 Go to previous messageGo to next message
Jaxim Flash is currently offline Jaxim FlashFriend
Messages: 8
Registered: June 2011
Junior Member
ok. I'm still at a loss on how on to sync my files and then upload my changes.
Re: Help: My Push was rejected [message #896773 is a reply to message #896490] Thu, 19 July 2012 16:50 Go to previous messageGo to next message
Jaxim Flash is currently offline Jaxim FlashFriend
Messages: 8
Registered: June 2011
Junior Member
So does anyone know what my issue is? I tired to do a "Pull" and it tells me everything is up to date, but it says that I have two pulled commits under "Update Result" that failed. Does this mean the pulled commits failed to merge? How do I merge what I pull - and how do I do it so I am sure I can see which version I want to keep? (For this version, anything local I want to overwrite anything I get remotely.)

thanks!
Jack

Re: Help: My Push was rejected [message #896791 is a reply to message #896773] Thu, 19 July 2012 19:06 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Jaxim Mising name skrev 2012-07-19 18.50:
> So does anyone know what my issue is? I tired to do a "Pull" and it
> tells me everything is up to date, but it says that I have two pulled
> commits under "Update Result" that failed. Does this mean the pulled
> commits failed to merge? How do I merge what I pull - and how do I do it
> so I am sure I can see which version I want to keep? (For this version,
> anything local I want to overwrite anything I get remotely.)

You should get some more info than "failed". Also look in the Error Log
in Eclipse for stack traces.

-- robin
Re: Help: My Push was rejected [message #896807 is a reply to message #896791] Thu, 19 July 2012 21:32 Go to previous messageGo to next message
Jaxim Flash is currently offline Jaxim FlashFriend
Messages: 8
Registered: June 2011
Junior Member
here's a screenshot of what happens when I try to do a "Pull"

URL=
farm9.staticflickr.com/8156/7605849754_46f31e31bb_o_d.jpg

(unfortunately I have less than 25 posts, so i can't include a direct image within this post. Instead you'll have to follow this flickr URL)

[Updated on: Thu, 19 July 2012 21:33]

Report message to a moderator

Re: Help: My Push was rejected [message #897651 is a reply to message #896807] Tue, 24 July 2012 22:04 Go to previous messageGo to next message
Jaxim Flash is currently offline Jaxim FlashFriend
Messages: 8
Registered: June 2011
Junior Member
Unless someone can suggest what I am doing wrong, I'm about to give up on GIT.

Supposedly GIT is the new "hotness" but unfortunately, it seems like it's geared for hard-core linux/git users rather than the casual user. At least that has been my take on it. So if I can't get my GIT to pull, merge, push - then I'm going to return to the land of SVN/subversion.

Does anyone have any suggestions what I am doing wrong?

I appreciate the help!
-Jack
Re: Help: My Push was rejected [message #898535 is a reply to message #897651] Thu, 26 July 2012 14:27 Go to previous messageGo to next message
Jaxim Flash is currently offline Jaxim FlashFriend
Messages: 8
Registered: June 2011
Junior Member
ok. I gave up on GIT and eGIT.

I've returned to using SVN. What egit needs is to make it easier for people to understand what to do next - to guide users to the next step. If the user attempts to push files, it should tell them that they need to perform a PULL action first. If the user attempts a PULL and it fails, then egit should tell the user how to fix the action. If the user needs to resolve some conflicts, it should tell the user the various options (in layman language) on how to resolve those conflicts.

I'm sure hardcore linux/open source people would scoff at the idea of a friendly GUI for GIT, but that is what it needs to make it easy for people to use. Open Source doesn't mean it has to be for the hard core fanatics. Just look at Android. Open Source could be inviting.

In any case, I have returned to using SVN/subclipse - another open sourced project which could also be improved with a better GUI but at least it is slightly easier IMHO to understand than GIT.

If anyone has ideas where I went wrong with GIT, then I am still willing to attempt any suggested solutions.

thanks,
Jack
Re: Help: My Push was rejected [message #989406 is a reply to message #896312] Thu, 06 December 2012 06:21 Go to previous messageGo to next message
Gorbunov Pavel is currently offline Gorbunov PavelFriend
Messages: 1
Registered: July 2012
Junior Member
I'm not hardcore linux user. I can only use gui, and i using svn before. Have this problems too and i don't understand ideology of git. First read this post, then forget that and just looking around interface of synchronize view and thinking simple, i make:
1) fetch remote changes
2) team - advanced - synchronize - my remote branch. Merge and fix local changes. Then mark project as merged.
3) commit project.
4) push - oops, non-fast-forward.
5) configure push - enable "force update" (because of "non-fast-forward" substring in help message Smile).
6) push again. All is ok.
Re: Help: My Push was rejected [message #991604 is a reply to message #989406] Wed, 19 December 2012 20:50 Go to previous messageGo to next message
David Coates is currently offline David CoatesFriend
Messages: 2
Registered: December 2012
Junior Member
I and everyone on my team has the exact same problem. Half the team already switched to NetBeans. I'm last hold out and about to give up. eGit just does not seem to work.
Re: Help: My Push was rejected [message #991612 is a reply to message #989406] Wed, 19 December 2012 21:16 Go to previous messageGo to next message
David Coates is currently offline David CoatesFriend
Messages: 2
Registered: December 2012
Junior Member
When I try to do an EGit Pull, I get the Pull Result dialog box that says, "Fetch Result No ref to fetch from origin - everything up to date." However, it's not up to date. Update Result says Result Failed and there are two updates listed in the Merge input area. Also the error Log shows a java.lang.ArrayIndexOutOfBoundsException with the following session Data:
eclipse.buildId=3.1.0.201210061306-RELEASE-e42
java.version=1.7.0_05
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.springsource.ggts.ide
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springsource.ggts.ide

Re: Help: My Push was rejected [message #996372 is a reply to message #991612] Tue, 01 January 2013 23:07 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
David Coates skrev 2012-12-19 22.29:
> When I try to do an EGit Pull, I get the Pull Result dialog box that says, "Fetch Result No ref to fetch from origin - everything up to date." However, it's not up to date.
> Update Result says Result Failed and there are two updates listed in the Merge input area. Also the error Log shows a java.lang.ArrayIndexOutOfBoundsException with the
> following session Data: eclipse.buildId=3.1.0.201210061306-RELEASE-e42
> java.version=1.7.0_05
> java.vendor=Oracle Corporation
> BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
> Framework arguments: -product org.springsource.ggts.ide
> Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springsource.ggts.ide
The Eclipse/JRE version information can't hurt but it rarely helps. What often does help
is the stack trace of an error, if there is one and. The version of the EGit plugin is sometimes
helpful.

The latest release, 2.2, of EGit contains a bug fix that may cause bogus merge failures, which in turn are
not reported in a way that is helpful to a user, so please try it out. I would not expect an
ArrayOutOfIndexException here, so it might be something we do not know about.

The reporting issue is not fixed in 2.2, but hopefully it'll be in a nighly build.
Look for https://git.eclipse.org/r/#/c/9386

-- robin
Re: Help: My Push was rejected [message #1001944 is a reply to message #989406] Thu, 17 January 2013 15:37 Go to previous messageGo to next message
Chris Raastad is currently offline Chris RaastadFriend
Messages: 1
Registered: January 2013
Junior Member
This more or less worked with me. I had the same issue when trying to sync the first time to a project on my github account. It took some playing with steps 1-4 but it eventually worked.

Gorbunov Pavel wrote on Thu, 06 December 2012 01:21

1) fetch remote changes
2) team - advanced - synchronize - my remote branch. Merge and fix local changes. Then mark project as merged.
3) commit project.
4) push - oops, non-fast-forward.
5) configure push - enable "force update" (because of "non-fast-forward" substring in help message Smile).
6) push again. All is ok.

Re: Help: My Push was rejected [message #1014944 is a reply to message #1001944] Tue, 26 February 2013 21:59 Go to previous messageGo to next message
Abby Bader is currently offline Abby BaderFriend
Messages: 3
Registered: February 2013
Junior Member
Jack,

My team had this problem a lot. The workflows that work with git and eGit seem to be:

EITHER:
1) commit local changes
2) pull changes (merge is automatic)
3) resolve any merge conflicts, ADDING files once the conficts are resolved

OR:
1) stash local changes
2) pull changes (no merge is needed)
3) apply stashed changes
4) verify that you haven't overwritten any pulled changes, because there's a bug in the current release of eGit


Both of these workflows should get you to a state where you can either continue working or commit if you're ready. The former is easier to do, so if you happen to be ready to commit -- do it.

Takeaway: Always commit or stash before you try to pull.


I agree that git seems to be harder, conceptually. I'm not in love with it, but it's what my team is using. I have high hopes that the plugin will continue to improve, now that the Eclipse devs are using it. (Right?)
Re: Help: My Push was rejected [message #1060488 is a reply to message #1014944] Sat, 25 May 2013 10:16 Go to previous messageGo to next message
Richard Harding is currently offline Richard HardingFriend
Messages: 2
Registered: May 2013
Junior Member
When creating a new GIT repository on the "Local Destination" page of the creation wizard, the Configuration => Remote name value is "origin" by default.

This is fine when you have only a single project, however if you have more than 1 if you do not give each of these a unique name then confusion results when pushing to the remote (as they all reference origin) resulting in the "my push was rejected error"

It causes I believe, this problem:
https://git.eclipse.org/r/Documentation/error-non-fast-forward.html#_you_are_pushing_the_commit_to_the_wrong_project

I cannot say that this is the cause for all versions of Eclipse but it certainly is for Zend Studio 10.0.1 - running on Eclipse Juno. I have to say that I think that given this problem, inserting a default of "origin" is a bit dim, and that at the very least the plugin should prevent using of the same name in more than a single repository

Re: Help: My Push was rejected [message #1060558 is a reply to message #1060488] Sun, 26 May 2013 21:21 Go to previous messageGo to next message
R Shapiro is currently offline R ShapiroFriend
Messages: 386
Registered: June 2011
Senior Member
The names of remotes are relative to each repository: 'origin' in repository A has nothing whatsoever to do with 'origin' in repository B. It's perfectly safe to use 'origin' as the name of a remote in every one of your repositories, just as it's perfectly safe to have a branch called 'master' in every repository. You don't have to use either of these names if you don't want to, but they're safe and reasonable defaults.

The URL re: pushing to the wrong project is about Gerrit code reviews, not Git in general. It has nothing to do with naming your remote 'origin', at least not that I can see.

As for multiple Eclipse projects in one repository, I don't see how that's relevant at all to push rejection.

I have seen developers run into what seems to be a puzzling case: they get the rejected push message but when they pull, Git says there's nothing new. What's going on here here is that they've configured their clone to push all branches. The one they're working on at the time is current so that push actually succeeds. The rejection is caused by some other branch that's not current.

The lesson here would seem to be this: if you want to push multiple branches, do it explicitly, not as a side-effect of a configuration option you might easily have forgotten you set. I now stick with 'push.default=upstream' (globally)
Re: Help: My Push was rejected [message #1105332 is a reply to message #991604] Mon, 09 September 2013 17:58 Go to previous messageGo to next message
Tobias Berthold is currently offline Tobias BertholdFriend
Messages: 1
Registered: September 2013
Junior Member
I also agree that git is not really easy to use. However, the one reason that I am using it is that deleting files and folders really works. This is the big difference between git and CVS/Subversion.

Here is a really crude way to resolve this: copy the contents of the problematic file to the clipboard. Delete the file, commit, and push. re-create the file and paste the clipboard. Commit and push the new file (that has the same name).

Try to do that with subversion and you are out of luck.
Re: Help: My Push was rejected [message #1352388 is a reply to message #896312] Tue, 13 May 2014 12:40 Go to previous messageGo to next message
Soichi Hayashi is currently offline Soichi HayashiFriend
Messages: 1
Registered: May 2014
Junior Member
I had the same issue reported originally on this thread, and I was able to fix this by rebase-ing to the origin/master via Eclipse.
Re: Help: My Push was rejected [message #1792104 is a reply to message #1001944] Wed, 11 July 2018 13:54 Go to previous message
Jiadong Zhang is currently offline Jiadong ZhangFriend
Messages: 1
Registered: March 2018
Junior Member
Chris Raastad wrote on Thu, 17 January 2013 15:37
This more or less worked with me. I had the same issue when trying to sync the first time to a project on my github account. It took some playing with steps 1-4 but it eventually worked.

Gorbunov Pavel wrote on Thu, 06 December 2012 01:21

1) fetch remote changes
2) team - advanced - synchronize - my remote branch. Merge and fix local changes. Then mark project as merged.
3) commit project.
4) push - oops, non-fast-forward.
5) configure push - enable "force update" (because of "non-fast-forward" substring in help message Smile).
6) push again. All is ok.





i solve my problem based on your suggestion,thanks。
while at the same time in 5),we can create a new branch in github.com to configure push
Previous Topic:How to use Git diff options
Next Topic:Clone to streams?
Goto Forum:
  


Current Time: Tue Apr 23 15:36:26 GMT 2024

Powered by FUDForum. Page generated in 0.04408 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top