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 (
Have you considered using LaTeX instead of doc or odt? This way you can edit the documents with any text editor and get good looking results. Better yet: you have proper diffs between revisions (no matter the SCM you use).
If you don't like the idea of editing the document in a simple text editor take a look at LyX. It provides a gui for editing documents like you would get in normal document editors.
For git hosting solutions you can use:
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
You can use LaTeX for text documents with format (or rtf, Rich Text File, if you prefer a method accesible to anyone), and fods for spreadsheets.
LaTeX is perfect for combining it for git. But if you cannot afford yourself the time to "translate" all to LaTeX, I think a great option that fits your needs is using LibreOffice and saving files in .fodt format (Open Document Text - Flat XML). These files are uncompressed XML, so you can use all the power of git as you can see addition and changes to the document line per line.
This will make merging an easy task. Even binaries (e.g. when you include an image) will be embedded in the document and shown as text. Of course you cannot manipulate them from there but you can remove the whole tag or edit attributes with the simplest text editor.