Is proprietary code legally safe on bitbucket or github? [closed]

Solution 1:

From GitHub:

We claim no intellectual property rights over the material you provide to the Service. Your profile and materials uploaded remain yours. However, by setting your pages to be viewed publicly, you agree to allow others to view your Content. By setting your repositories to be viewed publicly, you agree to allow others to view and fork your repositories.

As noted in the BitBucket TOS you linked, BitBucket's parent company similarly has no claims to code that you upload into private repos.

Solution 2:

Perhaps this has changed recently, but I think that BitBucket is quite clear with this (from their ToS)

Each party retains all right, title and interest in its data, information and intellectual property rights, and nothing in this Agreement is intended to transfer or diminish such rights.