If the code is GPL licensed, you can't relicense it under a non-FOSS license like you're talking about
> Don't they then have to remove that code?
Yes, if code gets uploaded whose license is incompatible with Microsoft's terms, they probably do have to remove it.
> Now imagine this: I write some code, license it, but don't publish it yet. It's licensed. Then I upload it to github. Does the license supersede the ToS? Doesn't github have to remove the code as a ToS violation
Again, yes, they probably do, and they also probably have an obligation to clean their training data of it. However, if you're the copyright holder of the code and you agree to their ToS before uploading, they might make the case that you agreeing to their ToS does grant them the license to use it in training data.
So then Github is breaking the law a significant portion of the time then at the very least?
Facebook wouldn't be able to allow users to upload photos.
Hacker news wouldn't allow me to post this comment (someone else could own the copyright, right?)
You are violating the law, probably. The ToS would say something like "I hereby declare that I hve the right to agree over the software to submit it under the ToS".
However, the reality is that this is all extremely muddy, far from proving that software A has copied some code from software B where you can just compare the source code. There are too many muddy steps, and you can bet that Microsoft will just get away with it.
It remains to be seen if they have a way to then clean their training data of the influence.
It would be the same situation if someone uploaded any other proprietary code.
Copyright isn't 'opt in'.
Before 1989, copyright protection was opt-in in the US.
If the github ToS supercedes the author's own licence, then I guess the uploader is effectively relicensing the code without the author's permission. That would mean the author has cause for action against the uploader, but not against github.
I personally dislike git; I find it too complicated, because of features I don't need. Microsoft has always disliked FOSS anf GPL, and I suspect that Copilot is a deliberate effort to undermine it.
You can't opt-out of those terms, regardless of your license, just as you can't opt out of Facebooks terms which give them the right to use your content for their business or marketing purposes, even if the various chain posts that have spread there might claim otherwise.