can git be used for version control on non text documents such as word doc or xls etc

I've been learning about the GIT version control system recently and It seems to work very well for plain text documents as you can add a single line, go back and fork it, revise the document and remove the line you just added. I program mostly in excel and write documentation in word. Can GIT be used to manage versions of these files (obviously not the stuff inside the files, but the files themselves?)

asked Jun 3, 2014 at 6:07 yoshiserry yoshiserry 21.1k 36 36 gold badges 79 79 silver badges 108 108 bronze badges

1 Answer 1

Git is agnostic in the sense that it doesn't matter which files you put under version control.

When git can't recognise the type of a file it just treats it as binary data for versioning purposes; so diff etc. will just state that the files are different by a number of bytes.

So to answer your question: Yes, Git can be used to manage versions of word documents etc., furthermore using gitattributes you can even diff word documents although I'm not sure if this is possible for xls files.

To learn more about the possibilities which gitattributes provide and to see some examples for diffing word files you can read the Customizing Git - Git Attributes chapter from the Gitpro book.