Gitlab is working on federation, or they at least have an open issue about it.[1]
Meanwhile there is a federated git as a reference implementation called Forgefed.[2]
1. https://gitlab.com/gitlab-org/gitlab/-/issues/6468
2. https://forgefed.peers.community/