How git stores snapshot -


GET, as stated, deltas but not snapshot . Now I have a very specific question.

Let's say I have a code and it's master

  #include  

And then I'll just change it to an additional line and add another reverse call to the last line of the last

  # Include & lt; Iostream & gt; using namespace std; Zero swap (four * a, int i, et j) {int t = a [ii]; A [i] = a [ja]; A [j] = t; } Zero Reverse (four * A, int size) {for (int i = 0; i & lt; size / 2; i ++) swap (a, i, size-1i); } Int main () {int n; Cin & gt; & Gt; N; Four a [n]; Int k; Cin & gt; & Gt; K; (Int i = 0; i & lt; n; i ++) cin & gt; & Gt; A [i]; Reverse (A, N-Kashmir); Reverse (A + N-Kashmir, Kashmir); Reverse (A, n); For (int i = 0; i & lt; n; i ++) COAT & LT; & Lt; A [i]; Cout & lt; & Lt; Endl; }  

And then I commit it to the same branch ( master ).

Now my question is, what does GIT Store really do not answer me? Snapshot I want to know whether the snapshot means technically what it means that it stores the entire file as it is, it will actually be disabled or it actually stores delta but if That's why, then why do they call them a snapshot?

A new blob for the modified file modified and then a new revised directory For trees and then a new commit and then put these three (and other objects created) in the object database.

Blob for a file is a binary object that contains the object type (blob), object size, and actual content. So, yes, if you modify only one row in a file, then GIT will store the whole thing twice, not only the difference

Normally, the disk for git speed and from that perspective It is not "disabled" by any means, in any way.

Although this method of storage (called called objects) is not particularly suited for transport, therefore, git has the ability to pack these loose items in the packed file and an index. The packing process will identify the small difference object, put them together and compile the delta into a packed file. They are more compact and more efficient than the transport point of view.

It is best that I can say in the words of your question. The link I commented on describes what happens when you store something in detail. If you have specific questions, please ask more precisely.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -