I have written a guide on how to set up a git server, and an explainer on how email works.

Building A git Repository Server using Gitea on Debian

An Overview of Email, and how it works