Is it possible to diff PowerPoint version-controlled with git?

前端 未结 4 761
太阳男子
太阳男子 2021-02-06 10:39

I have some PowerPoint documents that I keep version-controlled with git. I want to know what differences are between versions of a file. Text is most important, images and form

4条回答
  •  粉色の甜心
    2021-02-06 11:18

    I was unable to install python-pptx, as suggested by the accepted answer, so I looked for a node.js solution (that may also work for several other file formats that it can handle).

    Install https://github.com/dbashford/textract (npm install --global textract).

    Define how to diff "textract" in your .git config. For my Windows machine,

    [diff "textract"]
        binary = true
        textconv=textract.cmd
    

    Define in your .gitattributes that *.pptx file should use diff "textract"

    *.pptx diff=textract
    

    git diff happily.

提交回复
热议问题