Object := (sha1) -> (headers, body)
Commit (Object)
A commit represents a snapshot of files, in a time-like topology that cannot determine "time" for sure, but that has the notion of ancestors and descendants, so one can follow the logical history of changes.
Example:
tree 0fdc764f4c477e55f9326b1340af175cd823518c parent 723781bf7cc1a6eb8bdecd987975b8af7ed960bb author Romain Dorgueil <romain@dorgueil.net> 1459760873 +0200 committer Romain Dorgueil <romain@dorgueil.net> 1459760873 +0200 commit message is the body
Headers:
Tree (Object)
A tree has no header, only contains a list (one by line) of children, whith (perms, type, sha1, filename) as tab separated values. It represents what a regular filesystem would call a «directory», replacing inodes by hashes so the sub-nodes are identified in a universal namespace instead of a locally determined namespace.
Example:
40000 tree 67a00caf3712f4a38c9da6d14a07420530714fb5 doc 100755 blob d22a068dc89ac8d25532b0fea8829832e278ee7a docker-compose.yml
Blob (Object)
A blob is representing a file content. It's important to understand that it only represents the content, and not where is it in the filesystem or what name points to it. For example, if two files have the exact same content, it will be stored only once in the git object database, and the two tree entries (either in two different trees or even in the same tree) will point to the same sha1 hash.
Not perfect, but here is an UML-like schema of what is said above (TODO: make a better one)
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
git config --global user.name "Romain Dorgueil"
git config --global user.email "romain@dorgueil.net"
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
or
git config --global color.ui true