4

How can I merge two branches with magit interactively line by line. Important there is no conflict (well ONLY for git it isn't) but I still want to do this.

  • Well, you could revert the commit, rename the files you are interested in merging, then fetch files from the other commit you are merging with, then M-x emerge-files them. (See more on how emerge works here), this is even more hardcore than git reset --hard HEAD^1 && git difftool -t <call Emacs Ediff> HEAD^1 HEAD. But neither of them would be my choice. I typically do the initial merge in whatever quick way possible and then ammend the rest of the changes after merge. I've not seen yet a comfortable diffing tool. – wvxvw Feb 3 '16 at 19:41
3
  1. Press M-x magit-status
  2. Press m in magit status
  3. Activate the "No fast-forward" switch and do Merge but don't commit Action and press m again
  4. Now your files are changed but not committed, so you can merge them with your last commit state when you press e above the changed files that will bring you ediff and you're able to review the changes

Hope this will help you out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.