Last active
April 25, 2025 12:29
-
-
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 )
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
*.db diff=sqlite3 |
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 "sqlite3"] | |
textconv = sqlite3 $1 .dump | |
# drops a db file into sqlite3 and runs .dump before any diff comparisons |
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
git config --global diff.sqlite3.textconv 'sqlite3 $1 .dump' | |
echo '*.db diff=sqlite3' >> ~/.gitattributes |
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
# 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