Diff Word docx files in Sourcetree on Windows 7

I am trying to get text diff from Word.docx files that work in Sourcetree on Windows 7. I followed the instructions here Using Microsoft Word with git to use Pandoc and can make it work from the command line. Unfortunately, I cannot get this diff to appear in Sourcetree. Is there anything else I need to do to get this to work?

Here is my .gitattributes file that I put in the root of my project:

# Add diff of docx files.
*.docx diff=word

Here is my .git \ config file:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    hideDotFiles = dotGitOnly
[diff "word"]
  textconv=pandoc --to=markdown
  prompt = false
[alias]
  wdiff = diff --word-diff=color --unified=1
+4
source share
2 answers

. Pandoc , SourceTree, . , WinMerge xdocdiff. :

  • ( ), xdocdiff , ;
  • Windows PATH, ( );
  • , , xdoc2txt, (, ):

    > xdoc2txt
    Usage: xdoc2txt [-s|-e|-j][-c][-f][-r=(0|1|2)] <filename...>
            -s : convert to ShiftJIS(default)
            -e : convert to EUC
            -j : convert to JIS
            -f : output to file
            -c : activate PDF cache
            -p : print property
            -n : ignore permission on PDF;(require cryptlib.dll)
            -r=(0|1|2) : ruby style(0:suppress 1:parentheses 2:aozora bunko
            -o=0 : other option; -o=0:no show PDF page#
            -g=# : PDF gap parameter
            -v : show version number
            -x : output existing cell only(for EXCEL2007)
    

    , ;

  • .gitattributes :

    *.doc diff=xdoc2txt
    *.xls diff=xdoc2txt
    # ...
    # add any other supported extensions you need
    
  • .git\config :

    [diff "xdoc2txt"]
      textconv = xdoc2txt
      cachetextconv = true
      binary = true
      prompt = false
    

diff SourceTree.

+4

pandoc xdoc2txt SourceTree > Tools > Options > Git > Use System Git!!

0

Source: https://habr.com/ru/post/1608634/


All Articles