For China it's safer to have a Chinese Github ecosystem. Just imagine if Github suddenly decide to block Chinese users like they did for Iranian users.
It's also strategic for their government and some critical private sector to not put their source code on an American platform. So there are enough incentives especially after everything that happened to Huawei.