For merging I use this to \"keep mine\"
git merge -X ours foo
and this for \"keep theirs\"
git merge -X theirs foo <
git merge -X theirs foo
What about this one?
grep -v -e'^<<<<<<<' -e '^>>>>>>>' -e'=======' filename.txt > filename.tmp
mv filename.tmp filename.txt