10

I'm starting to experiment with Git, and I'm sure I'm missing something, as I can't do a simple merge and push

Here is what I do (I probably got it in the wrong order, or wrong in any order, please correct if it is)

  • pull
  • Syncronize Workspace
  • on conflicts - did a manual merge,
  • then "Mark as Merged" (is it necessary?)
  • on the rest - allowed the automatic merge
  • commit my changes
  • pressed push (origin-master)
  • I get the famous "rejected - non-fast forward"
  • did a "fetch" to check - nothing to update
  • did another commit - nothing to commit

What am I missing?

Not sure if it's relevant but I'm using Windows 7, EGit (1.3.0.201202151440-1) in Eclipse Indigo (SR2, build 20120216-1857) and pushing to GitHub

Cœur
  • 37,241
  • 25
  • 195
  • 267
Eran Medan
  • 44,555
  • 61
  • 184
  • 276

1 Answers1

19

I think I found it, instead of "Mark as Merged", I need to do "Add"

Manual conflict resolution

To resolve a conflict you have to do the following steps:

Navigate to the conflicting resource Edit the content of the conflicting resource Tell EGit that the conflict is resolved with Team -> Add

Commit the conflict resolution with Team > Commit

from http://wiki.eclipse.org/EGit/User_Guide#Manual_conflict_resolution

Edit: apparently, I should have learned git command line before playing with EGit, same concept there

Eran Medan
  • 44,555
  • 61
  • 184
  • 276
  • 7
    Looks like `Add` has been renamed to `Add to Index` – arun Aug 16 '14 at 13:51
  • @arun Thanks for writing this. I was searching for "Add" in "Team". – Mital Pritmani Nov 30 '15 at 12:01
  • 1
    as of today, this isn't working for me. the egit synchronize view is stubbornly displaying a conflict, despite multiple attempts to `add to index` and `merge` and `mark as merged`. I guess one of these actions foobarred it. my solution finally was to go to the Git Repository, select the local branch and do `Synchronize with workspace`, and then try to merge it again. – Adam Apr 07 '16 at 16:49