This is a great post that gets mentioned from time to time and covers the underlying theory well. I'd supplement it with Chapter 9 of the Pro Git book: http://progit.org/book/ch9-0.html , which focuses more on the actual implementation and shows how to create commits from scratch using Git's content-addressable primitives.