So, the question that bothers me is could the same happen to Bitcoin? What will happen to Bitcoin if the US Government suddenly decides to take down its Github repos?
Microsoft is going to create their own version called Billcoin, because they own Github

Seriously now, people should think about making transition from Github to Gitlab and other self-hosted alternatives.
It's unlikely this would happen for Bitcoin, but it could happen for many Bitcoin related services and exchanges, so it's better to be vigilant in time.
What if they ban all contributors, maintainers, and lead developers? Is there a place where the bitcoin codebase can migrate to? Are there other code hosting platforms besides Github that are not based in the US or upon which US Government sanctions have little to no influence? Is it possible to build a decentralized and distributed code hosting platform that no one can censor or shut off?
They have no reason to ban Bitcoin developers because they are not doing anything illegal, but in theory they can make anything illegal, even breathing.
Git is already decentralized by design, and there are some hosting option based on ipfs or onion that can be used, and anyone can host their own version.
It's a game of cat and mouse, they can't stop torrents for so many years and they won't be able to stop Bitcoin for sure.