Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • This only stores diffs? Commented Aug 20, 2010 at 12:40
  • 2
    Yes. It's very convenient! You can "check out" the file from any point in time, and git will automatically combine the diffs to give you the whole file as it existed at that time. Commented Aug 20, 2010 at 13:39
  • 1
    This blog post (not mine) goes into more detail: viget.com/extend/backup-your-database-in-git The comments get more into the pros & cons and caveats. I'll also add that if you use git, you get more than just being able to roll back versions. You can also tag dumps, or have separate branches (dev/prod). The way I look at it is git (or insert your favorite modern version control system) does a better job than I could by rolling my own diff/gzip 'solution'. One warning about this article: don't push your dumps to github unless you want them public (or are paying for a private repo). Commented Aug 20, 2010 at 17:10
  • 1
    Git does not only store diffs. In fact, primarily it stores the full snapshot of each revision, but with various optimizations. See this excellent answer and its question Commented Mar 31, 2014 at 7:16