# Choosing a mergetool according to file type

1 messages from 2009-06-26 to 2009-06-26. Participants: Gregory Jefferis.
Thread: https://gitlist.dev/t/19941

## Gregory Jefferis, 2009-06-26 10:28

Subject: Choosing a mergetool according to file type
Message-ID: <C66A614B.205E4%jefferis@gmail.com>
URL: https://gitlist.dev/e/C66A614B.205E4%25jefferis%40gmail.com

```
Dear all, 

Is there a way to specify which mergetool is called for different files in a
repository in the same way that one can specify a diff tool using
.gitattributes?  I would like to use a custom mergetool for certain binary
file types (MS Word dare I say it) but stick with my standard tool
(FileMerge.app) for regular files.

I have set up custom mergetool and diff commands in .git/config:

[mergetool "wordmergetool"]
   path = /Users/jefferis/bin/
   cmd = wordgitmerge "$PWD/$REMOTE" "$PWD/$BASE" "$PWD/$LOCAL"
"$PWD/$MERGED"
[diff "wordgitdiff"]
   command = wordgitdiff

# adding the following to gitattributes handles the diff case
*.doc diff=wordgitdiff

# but of course this doesn't alter the mergetool that is called.
*.doc mergetool= wordmergetool

Many thanks for any suggestions,

Greg.

git version 1.6.3.2.202.g26c11
MacOS X 10.5.7

-- 
Gregory Jefferis, PhD
Division of Neurobiology
MRC Laboratory of Molecular Biology,
Hills Road,        
Cambridge, CB2 0QH, UK.

http://www2.mrc-lmb.cam.ac.uk/NB/jefferis_g
http://www.neuroscience.cam.ac.uk/directory/profile.php?gsxej2
http://flybrain.stanford.edu

```
