https://git-scm.com/book/en/v2/Git-on-the-Server-GitWeb
But in both cases, the user has to have a server to put it on, making services like Sourcehut and Bitbucket (may it rest in peace) useful.
lighttpd not found. Install lighttpd or use --httpd to specify another httpd daemon.
Apparently, not.
A web UI is fine for being able to see the different commits, and files at different points in time.
But people also make use of GitHub as a hosted repository for sharing code with others, as an issue tracker, and for doing code review etc. -- for sharing things outside a local network, there's the understanding that either you're paying someone else to host it, or you're making effort to host it yourself, so "requires setup" isn't much of an issue.
"sourcehut competes with bitbucket" puts more emphasis on the latter than the former.