将Excel文件的版本保存在Git上,以便以后手动调和差异 [英] Save versions of Excel file on Git to reconcile differences manually later

查看:1438
本文介绍了将Excel文件的版本保存在Git上,以便以后手动调和差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将一个月更新Excel文件.这些文件使用英语以外的其他语言.我以为我也可以使用Git来管理我想做的事情.

I will be one month updating Excel files. These files are in a language other than English. I thought I could use Git too to manage what I want to do.

情况(初始提交)

我有一个用其他语言编写的Excel文件.

I have an Excel file that is written in the other language.

我必须执行一些工作,并用其中的数据填充Excel文件.

I have to perform some work and fill an Excel file with data from that.

我的计划

在初次提交后,创建一个名为toEnglish的分支.然后将Excel文件中的一些文本翻译成英文,以便让我感到更舒服.一旦执行此操作,我将承诺.

After an initial commit, create a branch called toEnglish. Then translate some text on the Excel files to English so that I feel more comfortable. Once I do this I will commit.

然后,将开始一个月的工作,我将数据填充到Excel文件中.我会定期提交.

Then, the one-month work will start and I will fill the data in the Excel file. I will commit periodically.

一个月结束后,我将提交,因此将数据填充到Excel页面中,其中一些标签为英文.

After the one month finishes, I will commit, and so I will have the data filled in a Excel page where some labels are in English.

但是,该月工作的输出必须使用原始语言显示这些标签.

However the output of that one month work has to have those labels in the original language.

所以我有一个带有原始语言标签但没有数据的原始分支 和toEnglish分支,带有数据但带有英文标签.

So I have a original branch with the original language labels but no data and the toEnglish branch with the data but English labels.

问题

我无法合并(快进合并)分支,因为这将消除原始语言标签,所以如何合并才能产生冲突(两种不同语言的标签),所以我将一一解决最终合并将具有原始语言的 数据和标签?

I can not merge (fast-forward merge) the branches since that will eliminate the original language labels, so how can I merge in order to produce conflicts (the labels in two different languages) that I will solve one by one so that the final merge will have both the data and the labels in the original language?

推荐答案

在Git中对Excel文件进​​行版本控制还有一个更大的问题,那就是Excel文件(xlsxlsx)是 binary . Git通常不能很好地处理二进制文件.您在Excel文件中进行的每次提交都可能会将整个文件记录为diff.此外,比较来自两个不同提交/分支的Excel文件不会带来太多的洞察力.

There is an even bigger problem with versioning Excel files in Git, which is that Excel files (xls and xlsx) are binary. Git doesn't generally handle binary very well. Each commit you make on an Excel file will likely record the entire file as the diff. In addition, comparing Excel files from two different commits/branches won't give you much insight.

想到的一种解决方法是对Excel工作表的纯文本CSV版本进行版本控制.这样的CSV文件将很可能与Git版本兼容.当然,如果工作表在数据之上有很多丰富的内容,则此选项可能无法正常工作.

One workaround which comes to mind would be to version plain text CSV versions of your Excel worksheets. Such CSV files would likely version well with Git. Of course, if the worksheets have lots of rich content on top of the data, then this option might not work as well.

这篇关于将Excel文件的版本保存在Git上,以便以后手动调和差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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