git diff --name-only | uniq | xargs mvim
When git encounters a merge conflict, e.g. during a rebase, it drops you back into the shell with a dirty working directory. I like this one-liner for opening all files with a merge conflict in MacVim.
Once you're in Vim, you can then switch between the files with :n and :prev, or another favourite: :w | n (save current file and open the next command line-supplied file).
UPDATE: see below for a version that works with real terminal commands.
As @suweller pointed out offline, this trick does not work for editors that run in the terminal. I found a nice explanation why on this Emacs mailing list; basically, you cannot use
xargsto launch programs that expect to interact with the terminal (/dev/tty).The following should work: