The very first commit to git has a great overview of how git works: https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23ca2e25604af290