Subject: Re: how the commit ID come from in GIT?

From: Magnus Bäck <[email-masked]>
Date: Mon, 5 Nov 2012 15:26:22 -0500

On Monday, November 05, 2012 at 15:04 EST,
     hong zhang <[email-masked]> wrote:

> Could anyone explain how the git commit ID will include all the files
> that devloper makes changes on?
>
> How git commit ID works?

In short, a Git commit points to a tree object that describes the full
state of the source tree plus metadata like the commit author, date,
description, and a pointer to the commit object(s) that preceded the
commit. The commit id itself is the SHA-1 of the contents of the commit
object. Any change of the source tree will affect the top-level tree
object's SHA-1 which in turn affects the SHA-1 of the commit. Also,
because a commit contains the timestamp of the commit object's creation
even two commits that are content-wise identical will have different
SHA-1s.

If you haven't read it, the Pro Git books explains Git's object model in
detail: http://git-scm.com/book/en/Git-Internals-Git-Objects

That description is quite detailed, and most users don't need to go that
deep.

-- 
Magnus Bäck
[email-masked]