git compare for docx file

https://github.com/vigente/gerardus/wiki/Integrate-git-diffs-with-word-docx-fileshtml

This section was inspired by Martin Fenner's "Using Microsoft Word with git".linux

To configure git diff:git

  1. Install pandoc.github

  2. Tell git how to handle diffs of .docx files.markdown

    1. Create or edit file ~/.gitconfig (linux, Mac) or "c:\Documents and Settings\user.gitconfig" (Windows) to addcode

      [diff "pandoc"]
         textconv=pandoc --to=markdown
         prompt = false
       [alias]
         wdiff = diff --word-diff=color --unified=1
    2. In your paper directory, create or edit file .gitattributes (linux, Windows and Mac) to addhtm

      *.docx diff=pandoc
    3. You can commit .gitattributes so that it stays with your paper for use in other computers, but you'll need to edit ~/.gitconfig in every new computer you want to use.blog

Now you can see a pretty coloured diff with the changes you have made to your .docx file since the last commitget

git wdiff file.docx

To see all changes over timeit

git log -p --word-diff=color file.docx
相關文章
相關標籤/搜索