With special thanks to caddy-fs-s3 for serving as a template.
Build Caddy using xcaddy
xcaddy build --with github.com/tecosaur/caddy-fs-git
file_server {
fs git <path/to/repo.git> [<revision=HEAD>]
}
file_server {
fs git {
repository <path/to/repo.git>
revision HEAD # the default revision
}
}