how to share odt/doc documents over git

后端 未结 4 2175
夕颜
夕颜 2021-02-13 17:04

the idea is that i want to share documents over git

i thought about using Text Document (looks like docx,odt in functionality ) that can be edited with any text editor (

4条回答
  •  执念已碎
    2021-02-13 17:34

    There are two tools which can be used to let git diff odt files: odt2txt and oodiff.

    See this resource for details on how to set this up (also includes information on Mercurial and SVN.)

    Snippet of above instructions (for git >= 1.6.1):

    • First, install odt2txt, and configure git to allow it to run it, by adding this to ~/.gitconfig:

      [diff "odf"]
            textconv=odt2txt
      
    • Now, for each project, you just need to ask git to use this driver in .gitattributes or $GIT_DIR/info/attributes, like this:

      *.ods diff=odf
      *.odt diff=odf
      *.odp diff=odf
      

提交回复
热议问题