Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Last active March 25, 2024 12:38
Show Gist options
  • Save peteristhegreat/a028bc3b588baaea09ff67f405af2909 to your computer and use it in GitHub Desktop.
Save peteristhegreat/a028bc3b588baaea09ff67f405af2909 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