I know this slightly in the legal realm but its unclear who owns the code if you put proprietary code on github or bitbucket in a private repository.
From Bitbucket we have:
By submitting public (non-private) Content to Avantlumiere for inclusion on your Website, you grant Avantlumiere a world-wide, royalty-free, and non-exclusive license to reproduce, modify, adapt and publish the Content solely for the purpose of displaying and promoting your account or repository. If a repository is marked as private, these terms do not apply.
The question of course is what terms do apply to private accounts.
In theory the code should be safe if a license header with copyright information is on every file... right?
I am not asking for legal advice and will not hold any one responsible :)