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

☆樱花仙子☆ 提交于 2019-12-06 18:06:21

问题


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?)


回答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.



来源:https://stackoverflow.com/questions/24008184/can-git-be-used-for-version-control-on-non-text-documents-such-as-word-doc-or-xl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!