What's the simplest way to edit conflicted files in one go when using git and an editor like Vim or textmate? What's the simplest way to edit conflicted files in one go when using git and an editor like Vim or textmate? git git

What's the simplest way to edit conflicted files in one go when using git and an editor like Vim or textmate?


Here are a pair of aliases I have in my gitconfig, taken from the git wiki:

edit-unmerged = \    "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"add-unmerged = \    "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"

Should do what you want!


Shortest I can think of:

vim `git status|grep 'both modified'|cut -d: -f2`


Are you aware of the git mergetool command ? That doesn't open all the files in one go, but iterate on all needed files, which might be only what you need. You can even use vim to do the merge

git mergetool --tool=vimdiff