I’ve argued the opposite most of the time in build vs buy. Buy in almost every case unless it’s a real competitive advantage to you.
I know developers love to build, but do you think:
1) self-hosting git provides any competitive edge to the business over letting someone manage it?
2) it provides so much value that you’re willing to fund engineers to build, secure, support this on an ongoing basis?
I’ve found the answer to those is No in both cases.
The same reason you wouldn’t build your own internal chat tool, you’d use Slack. And you wouldn’t bother self-hosting your own Jira or documentation.
Code hosting is code hosting, there’s no difference where it's hosted. There’s no slowdown in delivery with using GitHub - their March uptime was 99.5% which annoys some commenters but it’s fine. That’s 45 minutes downtime per month which is tolerable.
You would spend way more effort and money building a jenky self-hosted solution to end up with a worse result.
You don't have to 'build' anything. Just spin up a GitLab docker container. Bonus: If you put it behind a VPN, you never have to worry about updating it.