Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save honzabilek4/ddb5c1c0573cc4e3b0728eb69cc8ea42 to your computer and use it in GitHub Desktop.
Save honzabilek4/ddb5c1c0573cc4e3b0728eb69cc8ea42 to your computer and use it in GitHub Desktop.
Sqlite git diff - Get git to use an sql dump of sqlite3 for showing differences ( .gitconfig config attributes sqlite3 )
[diff "sqlite3"]
textconv = sqlite3 $1 .dump
# drops a db file into sqlite3 and runs .dump before any diff comparisons
git config --global diff.sqlite3.textconv 'sqlite3 $1 .dump'
echo '*.db diff=sqlite3' >> ~/.gitattributes
# specific to the git tree you are in
git config diff.sqlite3.textconv 'sqlite3 $1 .dump'
echo '*.db diff=sqlite3' >> $(git rev-parse --show-toplevel)/.gitattributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment