Display changes with Git to zip's

狂风中的少年 提交于 2019-12-05 06:43:42

问题


I'm using git-gui on Windows Vista (via msysgit), and I'm trying to make the diff area (the yellow one) display changes in office files (eg .xlsx - they are really zipped up .xml files)

In C:\Users\Daniel\

.gitconfig
[diff "zip"]
textconv = unzip -c -a

In repository: (As a side note, I'd rather have this in C:\Users\Daniel, what should I do?)

.gitattributes
*.xlsx diff=zip

After committing an .xlsx file, changing it and rescanning, I get this message:
Binary files a/notes/GaussianMountain.xlsx and b/notes/GaussianMountain.xlsx differ

Instead of an output listing the changes made! What's wrong?


回答1:


Update: it seems from the comments below that the problem for the questioner was needing a later version of git-gui / msysGit. However, there are a couple of other problems I had while trying to reproduce the issue, which are described below.

I think I managed to reproduce this: the problem seems to be that I had the checkbox "Use TextConv For Diffs and Blames" selected in Git Gui's Edit > Options... dialog. When I turned off that option, it worked fine -- counterintuitively, to my mind, although that's also documented on the TextConv page on the git wiki.

The other problem I had was that the converter I was testing with (strings) wasn't on my path, so I had to put a full path in my .gitconfig:

[diff "stringify"]
    textconv = c:/cygwin/bin/strings.exe

However, if this had been the problem for you I don't think you would have seen the "Binary files A and B differ" message at all, so I suspect it's the former causing the problem.



来源:https://stackoverflow.com/questions/4704873/display-changes-with-git-to-zips

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