Skip to content

Instantly share code, notes, and snippets.

@pascaliske
Last active April 16, 2024 14:32
Show Gist options
  • Save pascaliske/53648334378d592c0c2cc62b989a027e to your computer and use it in GitHub Desktop.
Save pascaliske/53648334378d592c0c2cc62b989a027e to your computer and use it in GitHub Desktop.
Collection of useful diff tools for git

Useful git diff tools

Overview

  • Word: docx2txt (brew install docx2txt)
  • Excel: xlsx2txt
  • PDF: pdf2txt (brew install poppler)
  • Images: exiftool (brew install exiftool)

Setup

~/.gitconfig

[core]
    attributesfile = ~/.config/git/attributes
[diff "word"]
    textconv = docx2txt
[diff "excel"]
    binary = true
    textconv = xlsx2txt
[diff "pdf"]
	textconv = pdf2txt
[diff "exif"]
    textconv = exiftool

~/.config/git/attributes

*.docx diff=word
*.xlsx diff=excel
*.pdf diff=pdf
*.png diff=exif
*.jpg diff=exif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment