Created
May 10, 2012 16:01
-
-
Save kbaird/2654115 to your computer and use it in GitHub Desktop.
Binary diff setup in .git/config
This file contains hidden or 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 "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) |
If you want to put .gitattributes
in your $HOME
then you will have to put this into your ~/.gitconfig
:
[core]
attributesFile = ~/.gitattributes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See also https://git.wiki.kernel.org/index.php/GitTips for LibreOffice files. odt2txt is available as an apt package.