如何对 Excel 文件和 SQL 架构文件执行更好的文档版本控制 [英] How to perform better document version control on Excel files and SQL schema files
问题描述
我负责几个 Excel 文件和 SQL 架构文件.我应该如何对这些文件进行更好的文档版本控制?
I am in charge of several Excel files and SQL schema files. How should I perform better document version control on these files?
我需要知道这些文件中修改的部分(不同的部分)并保留所有版本以供参考.目前我在文件名上附加时间戳,但我发现它似乎效率低下.
I need to know the part modified (different part) in these files and keep all the versions for reference. Currently I am appending the time stamp on the file name, but I found it seemed to be inefficient.
是否有更好的文档版本控制方法或良好做法?
Is there a way or good practice to do better document version control?
顺便说一下,编辑通过电子邮件将文件发送给我.
By the way, editors send me the files via email.
推荐答案
因为你已经用 git 我想你是在询问 Git 的用法.
Since you've tagged your question with git I assume you are asking about Git usage for this.
好吧,SQL 转储是普通的文本文件,因此使用 Git 跟踪它们非常有意义.只需创建一个存储库并将它们存储在其中.当您获得文件的新版本时,只需覆盖它并提交,Git 会为您计算所有内容,您将能够查看修改日期、检查此文件的特定版本并比较不同版本.
Well, SQL dumps are normal text files so it makes perfect sense to track them with Git. Just create a repository and store them in it. When you get a new version of a file, simply overwrite it and commit, Git will figure out everything for you, and you'll be able to see modification dates, checkout specific versions of this file and compare different versions.
对于 .xlsx
也是如此,如果你解压它们..xlsx
文件是 XML 文件目录的压缩文件(请参阅如何从其内部子组件正确组装一个有效的 xlsx 文件?).除非解压缩,否则 Git 会将它们视为二进制文件.可以解压缩 .xlsx
并跟踪存档中各个 XML 文件的更改.
The same is true for .xlsx
if you decompress them. .xlsx
files are zipped up directories of XML files (See How to properly assemble a valid xlsx file from its internal sub-components?). Git will view them as binary unless decompressed. It is possible to unzip the .xlsx
and track the changes to the individual XML files inside of the archive.
您也可以使用 .xls
文件执行此操作,但这里的问题是 .xls
格式是二进制的,因此您无法从中获得有意义的差异.但您仍然可以查看修改历史记录并检查特定版本.
You could also do this with .xls
files, but the problem here is that .xls
format is binary, so you can't get meaningful diffs from it. But you'll still be able to see modification history and checkout specific versions.
这篇关于如何对 Excel 文件和 SQL 架构文件执行更好的文档版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!