Skip to main content
7 votes
Accepted

Jump to next merge conflict in project using Magit and Smerge

Just 7 hours ago to Smerge was added a new command to do exactly that. Now you can use M-x smerge-vc-next-conflict to either jump to the next conflict in focused buffer or to the next conflicted file ...
Hi-Angel's user avatar
  • 878
5 votes
Accepted

When merging conflicts in the smerge mode, how to select "mine" for all conflicts in the file?

Sure, the following function works for me to automatically resolve all conflicts inside a file: (defun smerge-resolve-all-in-file-to (to-keep) "Resolves all conflicts inside a file in ...
Hi-Angel's user avatar
  • 878
4 votes
Accepted

Key binding for Smerge

It looks like this will take effect if you restart Emacs. Alternatively, M-x load-library RET smerge RET will process it. (In which case the old prefix will also remain active, until you restart.)
phils's user avatar
  • 53.1k
2 votes

Key binding for Smerge

smerge-command-prefix is used by smerge.el when the smerge.el file is loaded. So you need to perform your setq before smerge.el is loaded. My crystal ball tells me that you likely have something in ...
Stefan's user avatar
  • 26.7k
2 votes
Accepted

finding git conflict in the same buffer if cursor is at end of the buffer

Good idea. Here's a next-conflict function that wraps around whenever there is no more conflicted files, but the current one still has conflicts: (defun next-conflict () (interactive) (let ((...
Hi-Angel's user avatar
  • 878
1 vote
Accepted

Is it possible to apply `smerge-keep-mine` for all the conflicts by using a single keybinding?

As far as I know, no smerge does not provide that functionality.
tarsius's user avatar
  • 26.3k
1 vote

Merging diffs/hunks

I think you're looking for M-x smerge-combine-with-next RET.
Stefan's user avatar
  • 26.7k
1 vote
Accepted

Automatically merge files

EDIT in response to your comment Seems like indeed configuring the smerge-begin-re, smerge-lower-re, and smerge-end-re as follows before you activate smerge-mode (setq-local smerge-begin-re "^#...
dalanicolai's user avatar
  • 7,985
1 vote
Accepted

How can I apply `smerge-refine` for all conflicts by default using `smerge`?

If you set or customize diff-refine to a non-nil value then smerge-refine is applied "automatically" in smerge-next. See the doc string of diff-refine for the valid values: If non-nil, ...
Tobias's user avatar
  • 33.7k
1 vote
Accepted

How to disable `flycheck` while merging Git conflicts

You can use M-x flycheck-mode to turn off flycheck in current buffer. Or alternatively, you can disable it for specific hooks (in this case smerge-mode): (add-hook 'smerge-mode-hook (lambda () (...
deprecated's user avatar
1 vote

Jump to next merge conflict in project using Magit and Smerge

Magit does not support that currently, but I have just added a note to a related feature request.
tarsius's user avatar
  • 26.3k
1 vote
Accepted

Resolve git merge conflict by applying diff hunk to different file

Use C-c c-e in the vc-diff buffer to apply the diff to a file. Enter the target filename and press RET. This will launch ediff and attempt to apply the patch. For me, the patch applied successfully ...
Robin Green's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible