0

I am really new to git. We are some to work on a project. I pulled the first time the git on week ago. Then numbers of modifications have been made since. I then tried to commit and push some modification, here's the message I got :

error: failed to push some refs to 'ssh://forumdesy@ftp.forumdesthinktanks.fr/homez.353/forumdesy/sources'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again.

The I pulled, and here's the message :

...(a list of auto-merging and conflicts and )...
Automatic merge failed; fix conflicts and then commit the result.

How can I fix that ?

Best, Newben,

Felix Kling
  • 705,106
  • 160
  • 1,004
  • 1,072
epsilones
  • 10,137
  • 18
  • 57
  • 80
  • 2
    possible duplicate of [How do I fix merge conflicts in Git?](http://stackoverflow.com/questions/161813/how-do-i-fix-merge-conflicts-in-git) – Felix Kling May 02 '12 at 10:15

1 Answers1

3

This is answered in more detail in How do I fix merge conflicts in Git?, however here's the short answer:

If you use an IDE such as Eclipse with eGit, you should see some red markers next to files that are in conflict. Alternatively, when you did git pull, it should have said said exactly which file(s) were in conflict. You should be able to see this list with git status if you no longer have the list.

Edit these files: you'll see <<<<< markers where their version and your version are in conflict and git could not automatically merge the changes. Edit the file(s) to deal with the conflict, remove the <<<<< markers, test your code locally, and then add the files back using git add for each you have resolved. Then commit and push again.

Community
  • 1
  • 1
shrikeh
  • 641
  • 9
  • 12
  • Ok, thanks for your quick response. I'll come back soon to inform you. Best, Mehdi – epsilones May 02 '12 at 10:34
  • Hey, in fact there were many people working on the project ad so a lot of conflict. As soon as resolved, everything went wright !Best, Newben – epsilones May 14 '12 at 01:43