I prefer to compare apples to apples. Git is distributed. If you host your repo on Github, you can very well just push that same Git repo to Sourcehut or your private Git server.
But otherwise, yeah, I would warn against potential vendor lock-in, especially if that service is not open-source.