可以将git用于非文本文档(例如word doc或xls等)的版本控制 [英] can git be used for version control on non text documents such as word doc or xls etc

查看:882
本文介绍了可以将git用于非文本文档(例如word doc或xls等)的版本控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在学习有关GIT版本控制系统的信息,它对于纯文本文档似乎非常有效,因为您可以添加一行,返回并进行分叉,修改文档并删除刚刚添加的行

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.

我主要使用excel编程,并用Word编写文档.可以使用GIT来管理这些文件的版本(显然不是文件内的东西,而是文件本身吗?)

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

推荐答案

Git是不可知的,因为您将哪个文件置于版本控制之下并不重要.

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

当git无法识别文件类型时,它只是将其视为二进制数据以进行版本控制;因此diff等仅会指出文件之间的差异在于字节数.

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.

因此回答您的问题:是的,Git可用于管理word文档等的版本,此外,使用gitattributes您甚至可以区分word文档,尽管我不确定xls文件是否可行

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.

要了解有关gitattributes提供的可能性的更多信息,并查看一些差异词文件的示例,请阅读 自定义Git的Git-Git属性 一章.

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.

这篇关于可以将git用于非文本文档(例如word doc或xls等)的版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆