0

I've read here that Git does not store file deltas but instead store the whole if it has been changed.

Consider the image below: enter image description here

Consider version 1 and 2, if Git had store only the delta of A and A1, would it be better in terms of size?

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
Noor
  • 19,638
  • 38
  • 136
  • 254
  • Related (answer mostly covers linked resource): http://stackoverflow.com/questions/8198105/how-does-git-store-files?lq=1 – user2864740 Feb 12 '14 at 03:47
  • 6
    However, I believe that is on the *conceptual* level .. from a comment in the linked Q: "While that's true and important on the conceptual level, it is NOT true at the storage level. Git does use deltas for storage. Not only that, but it's more efficient in it than any other system. Because it does not keep per-file history, when it wants to do delta-compression, it takes each blob, selects some blobs that are likely to be similar (using heuristics that includes the closest approximation of previous version and some others), tries to generate the deltas and picks the smallest one" – user2864740 Feb 12 '14 at 03:48
  • See also http://stackoverflow.com/a/7321409/2864740 – user2864740 Feb 12 '14 at 03:51

1 Answers1

1

Yes, it would be better in terms of size. But size was the least important factor when Linus made the decision. Your link clearly explains why the decision to store the entire file was made, so just keep reading that site (it's really very good!).

Paul Hicks
  • 13,289
  • 5
  • 51
  • 78