One thing that bugs me when using Git, is that resolving merge conflicts isn’t a seamless process. It involves the fiddly task of opening files which conflicted, then resolving the conflict and then staging the changes.
The part which bugs me the most is having to either type the full filename in order to open it in any editor, OR i have to use the mouse to clipboard the filename and then paste it onto the commandline. Just not straightforward enough.
So i knocked up a quick bash script which makes use of git’s ability to create extensions for git commands. This script issues a rebase (i also have one for merge) and will fire off my preferred editor for editing files outside Visual Studio.
#!/bin/bash # git-resolve-rebase git rebase $1 modified=`git status | grep 'unmerged' | uniq` if [ -n "$modified" ]; then git status | grep 'unmerged' | awk '{print $3}' | uniq | xargs -n1 e fi
(where e is the shell-script to launch E-Text Editor
To use this extension, all i need to do is:
$ (MyBranch)> git resolve-rebase master
Why not just register your preferred diff tool in the git config, and then just use the git mergetool command?
http://www.kernel.org/pub/software/scm/git/docs/git-mergetool.html
well fuck…..
i knew of git difftool, just never realised the equivalent git mergetool.
cheers!
Any time!