They could have gained access to the employee's machine, and at that point it's easy even if you have 2FA required - in most cases it's required for accessing the web client, not server via git command.
Employee could also have gh tool available or access token stored somewhere.