You can use GitHub Enterprise on prem. Gitlab also has multiple self host options.
But, even if the hosting of the code is locked down behind a VPN, the nature of it requires copying it somewhere else, perhaps to a laptop that gets lost/stolen. But that is an attack vector and risk that is not addressed by having the revision control only accessible via VPN (although it may provide access auditing capabilities to help mitigate/observe where copies of the code exist).