Last active
November 4, 2022 08:57
-
-
Save SeanSobey/a9b3d5b184046336e004ac7ee13b8d85 to your computer and use it in GitHub Desktop.
Git to diff zip (or any compressed) files. See this (https://tante.cc/2010/06/23/managing-zip-based-file-formats-in-git/) article.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.[7z,xz,bzip2,gzip,tar,zip,wim,ar,arj,cab,chm,cpio,cramfs,dmg,ext,fat,gpt,hfs,ihex,iso,lzh,lzma,mbr,.msi,nsis,ntfs,qcow2,rar,rpm,squashfs,udf,uefi,vdi,vhd,vmdk,wim,xar,z] diff=archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[diff "archive"] | |
textconv = 7z -so e | |
binary = true |
Sorry forgot to add the (project level) .gitattributes
config. (You can make a global .gitattributes
file).
Updated the gist (also removed the superfluous git-lfs
config).
This also assumes you have 7z installed.
Thanks @SeanSobey for sharing!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't seem to do anything for me when I
git diff
in a repo with tracked zip files, how is it supposed to work? I can't find anything inman git-config
about this syntax of including a file extension in a[diff]
stanza.