0

I did some changes while switching a branch called users-authentication, I commit them. then I switched again to master to merge these changes as the command line below. It says there is a conflict while merging. how can I solve it, I really don't want to lose anything.

$ git merge users-authentication
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Moh
  • 249
  • 3
  • 15
  • 1
    You seem to know very little about git and merging. Please read some introduction, like http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging , then ask a more specific question. – sleske Jan 23 '14 at 12:40
  • Thanks sleske for the link, yes I am just starting to use branches. I tried some solutions before, I could solve the problem by git reset --merge but when I tried to do it again the same happen. what I want exactly is working on that branch which already existing, commit the changes, then merge them from master. is that possible? here I am a bot lost – Moh Jan 23 '14 at 13:13

1 Answers1

0

Either you can edit the files in conflict manually, and do a commit again. Otherwise you can use

$> git mergetool

Now you can decide whether to keep your change or their change.

    git checkout --ours FileYouWantToKeepYourChange
    git checkout --theirs FileYouWantToKeepTheirChange
    git add FileYouWantToKeepYourChange, FileYouWantToKeepTheirChange
    git commit -m "Conflict resolved"
  • I tried to modify those files making the conflict but no way! I solved the problem by committing from the master, this is not I Want but well! – Moh Jan 23 '14 at 13:18