git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: what is a snapshot?

From
Philip Oakley <philipoakley@iee.org>
Date
Jun 19, 2016, 15:20 UTC
Message-ID
<F6172B8DA802476C863849DEA02684A7@PhilipOakley>
In-Reply-To
<CAHWPVgMWeHoD5vTiFJ1gsm2hS74LK7j4npVVbOZeR43cX3qWXw@mail.gmail.com>
From: "Ovatta Bianca" <ovattabianca@gmail.com>
Show 6 quoted lines
>I read in every comparison of git vs other version control systems,
> that git does not record differences but takes "snapshots"
> I was wondering what a "snapshot" is ? Does git store at every commit
> the entire files which have been modified even if only a few bytes
> were changed out of a large file?
>

A snaphot is like a tar or zip of all your tracked files. This means it is easier to determine (compared to lots of diffs) the current content.

Keeping all the snapshots as separate loose items, when the majority of their content is unchanged would be very inefficient, so git then uses, at the right time, an efficient (and obviously lossless) compression technique to 'zip' all the snapshots together so that the final repository is 'packed'. The overall effect is a very efficient storage scheme.

There are some good explanations on the web, such as the https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain though you may want to scan from the beginning ;-)

--
 Philip 
Previous: Ovatta BiancaNext: Jeff King
Message 2 of 4 in “Fwd: what is a snapshot?”
  1. Ovatta BiancaJun 19, 2016
  2. Philip OakleyJun 19, 2016
  3. Jeff KingJun 24, 2016
  4. Jakub NarębskiJun 29, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.