There’s automation and you can do it manually if needed. For example I have a couple of emulators that pull every 24 hours from GitHub just in case nint tendo gets a little lawsuit heavy. I also have one offs from GitHub that pull down when I want.
You can also mirror a public repo from GitHub into a private repo so it does not gets indexed/ai trained.
When the worst case is to lose your job and never deal with the legacy code again.