How is the Git semantics of merge, rebase and diff defined in the system?

[dead]