On 2016-05-20, at 8:53 PM, Sharan Basappa <sharan.basa...@gmail.com> wrote:

> Sure. Think of Git as a three layered tool. 
> The top layer is a polished interface, called "Porcelain", that is designed 
> to easily manage snapshots and compares and merges of filesystem trees. 
> The bottom layer, on the other hand, is a filesystem. Files in this 
> filesystem are read-only. The names of files are fixed based on their 
> content. So identical files have the same name, and are stored once in the 
> file system. 
> Building up from fixed files that do not change, are directory objects, that 
> map human understandable filenames to internal names. And, since this is 
> itself a filesystem object, if everything in a directory is identical, then 
> the directory entry is identical, and only stored once. 
> Based on this, it's pretty easy to see that if two commits are completely 
> identical, then the only thing that differs is the commit object itself, 
> which will have a time stamp and user comment. 
> (The middle layer by the way, are low-level tools designed to work with the 
> files in this filesystem.) 
> Dear Michael & Philip,
> Thanks. I think I am getting a hang of it.
> So, when an existing file is modified then I assume that Git computes its 
> signature and then checks if such a file already exists.
> Is this correct? I ask this because my change can be such that it is same as 
> one that was previously committed (sort of reverting back a file).

Yep. Once git knows the signature (a "hash"), it also knows a filename that 
identifies a file with that hash. If it sees the filename in use, it knows it 
has a duplicate.

Reverting changes is common enough that there are commands to do it. They are 
among the most complicated ones given all the warnings in the manual :-)

> The other thing I understand is that Git always stores every unique instance 
> of a file as it is and not its differences with a reference file.


> One more question I have is on the file system. As such when I clone a 
> repository, I get full repository and files locally.
> So, when I clone a repository, I have full repository and one set of project 
> files (depending on the branch I have checked out) locally)


Now, just a few months ago, I had these same questions. I hope I have learned 
this well enough that I can teach it accurately.

Entertaining minecraft videos

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to