You cannot (yet) do git to do this.
This may or may not be an acceptable solution.
Create a function in ~/.bashrc :
git() { if [[ $1 == "merge" ]] || [[ $1 == "rebase" ]] || [[ $1 == "pull" ]]; then command git "$@" rc=$? if [[ $rc == 1 ]]; then echo "There are conflicts, better run git-mergetool!!!"
Mergetool is not called upon merge:
$ git merge non_conflicting_branch Merge made by the 'recursive' strategy. bar | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 bar
Mergetool is called when conflicts occur:
$ git merge conflicting_branch Auto-merging foo CONFLICT (content): Merge conflict in foo Automatic merge failed; fix conflicts and then commit the result. There are Conflicts, better run git-mergetool!!!
Mergetool is not called on other errors:
$ git merge adasds fatal: adasds - not something we can merge
onionjake Jul 17 '13 at 7:35 2013-07-17 07:35
source share