備忘録です。mergeは考えてません。
相変わらずgit-svn使って中央サーバーはsvnですが、最近アプライアンスとかの設定ファイルがsqlite3形式だったりするので、変更内容の差分を見たい時用の設定
1 2 |
git config diff.sqlite3.textconv 'echo .dump|sqlite3' echo '*.db diff=sqlite3' >> .gitattributes |
sqlite3、members作成
1 2 3 4 5 6 7 8 9 |
[kota@mbp13 ~/Git/test]$ sqlite3 git.db SQLite version 3.7.15.2 2013-01-09 11:53:05 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> create table members(id, name); sqlite> insert into members values (0,"kota"); sqlite> select * from members; 0|kota sqlite> .quit |
git addして
1 |
[kota@mbp13 ~/Git/test]$ git add git.db |
変更を加える
1 2 3 4 5 6 7 |
[kota@mbp13 ~/Git/test]$ sqlite3 git.db SQLite version 3.7.15.2 2013-01-09 11:53:05 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> insert into members values (1,"shige"); sqlite> insert into members values (2,"hitoshi"); sqlite> .quit |
diffってみる
1 2 3 4 5 6 7 8 9 10 11 12 |
[kota@mbp13 ~/Git/test]$ git diff diff --git a/git.db b/git.db index d8c1c21..36cf739 100644 --- a/git.db +++ b/git.db @@ -2,4 +2,6 @@ PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE members(id, name); INSERT INTO "members" VALUES(0,'kota'); +INSERT INTO "members" VALUES(1,'shige'); +INSERT INTO "members" VALUES(2,'hitoshi'); COMMIT; |