Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8798991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:13:04+00:00 2026-06-14T00:13:04+00:00

I have a Sqlite db in a Git repository. Today I wanted to do

  • 0

I have a Sqlite db in a Git repository. Today I wanted to do a diff of a view in two different commits. I did it this way:

$ sqlite3 -list file.sqlite "SELECT * FROM contact_list_detailed" >/tmp/newlist
$ git checkout 51c24d13c file.sqlite
$ sqlite3 -list file.sqlite "SELECT * FROM contact_list_detailed" >/tmp/oldlist
$ git checkout -- file.sqlite
$ diff /tmp/oldlist /tmp/newlist

It works and I could script it if I want. But are there any “nice” ways of doing this with hooks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:13:05+00:00Added an answer on June 14, 2026 at 12:13 am

    You would use HEAD and HEAD^ to access the previous and current revisions; see git post-commit hook – script on committed files for an example.

    Use git show to extract files to a temporary directory without overwriting the working copy.


    I wouldn’t store binary files in git unless absolutely necessary.
    You can avoid many hassles if you create a text file of SQL commands with sqlite3 file.sqlite .dump and put that into git, having the binary database only as a generated file.
    (But then you have to care about regenerating the SQL file when necessary.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a django application that uses an SQLite database. I use git to
I have a repository with a sqlite development database along side the code. Any
I have a rooted Nexus S and it doesn't have Sqlite installed so I
I have my SQLite db storing my info and it works ok. However I
I have an sqlite database I want to distribute with my application. It's about
I have a sqlite table representing a weighted directed graph. The columns are as
I have an SQLite database in my application. When I go to check if
I have normal sqlite database and want to use fts3. As mentioned in http://www.sqlite.org/fts3.html
I have a SQLite database that contains a huge set of log messages. I
I have a SQLite table called posts . An example is shown below. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.