Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Binary diff setup in .git/config
[diff "bz2"]
binary = true
textconv = /bin/bzcat
[diff "gzip"]
binary = true
textconv = /bin/zcat
[diff "tar"]
binary = true
textconv = tar --to-stdout -xf
[diff "tar-bz2"]
binary = true
textconv = tar --to-stdout -xjf
[diff "zip"]
binary = true
textconv = unzip -p
Add the above or similar to your .git/config, along with entries like below in ~/.gitattributes, the project's .gitattributes (to check it in) or .git/info/attributes (to not check it in):
*.bz2 diff=bz2
*.gz diff=gzip
*.tar diff=tar
*.tar.bz2 diff=tar-bz2
*.zip diff=zip
(References http://git-scm.com/book/ch7-2.html)
@kbaird

This comment has been minimized.

Copy link
Owner Author

kbaird commented Nov 13, 2013

See also https://git.wiki.kernel.org/index.php/GitTips for LibreOffice files. odt2txt is available as an apt package.

@refractalize

This comment has been minimized.

Copy link

refractalize commented Apr 12, 2016

If you want to put .gitattributes in your $HOME then you will have to put this into your ~/.gitconfig:

[core]
  attributesFile = ~/.gitattributes

See https://git-scm.com/docs/gitattributes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.