17

Say I'm the only one uploading code to someone's private repository, do they own the copyright to the code? Or do I own the copyright to the code since I wrote it?

Would adding a license stating that I own the code and the terms of usage suffice in this situation?

  • 1
    I'm voting to close this question as off-topic because it doesn't seem to be specifically about free/open source projects – curiousdannii May 24 '16 at 23:32
  • 4
    @curiousdannii this is does not seem off topic to me. I guess the that Riptyde4 means that the license is a FLOSS license. Is this correct? – Philippe Ombredanne May 25 '16 at 8:19
  • 1
    This question is being discussed on meta. – Zizouz212 May 26 '16 at 1:47
14

When you put code on GitHub, you retain all the copyright to your code.

However, you do grant GitHub a license to host the code, and you also allow GitHub users a set of rights - namely the ability to look at, and fork your repository. These are terms that you have accepted when accepting their Terms of Service when creating a GitHub account.

Even when you upload code to someone else's repository (such as via pull request), you still own the copyright to that code, unless you have signed a copyright assignment agreement. You own the code, but you may be providing the code when uploading the code to the repository. For example, if you upload code to an Apache licensed repository, you submit your contributions under the Apache license as well. This gives others rights to your code, but you still retain the copyright.

Would adding a license stating that I own the code and the terms of usage suffice in this situation?

A license is used to grant rights to other people. If you want to explicitly assert copyright to your code (which is recommended, but not necessary as all copyright is automatic), then you can use the following header:

Copyright © 2016 Riptyde4
  • "you also allow GitHub users a set of rights - namely the ability to look at, and fork your repository." Is this true even for private repos? – Patrick Dec 12 '18 at 2:07
  • @Patrick of course not! Private repos are private so no one can see them except those you grant access. So you need to be careful to have a good license if you share your private code with someone. Otherwise, if it's only you, then no! PS: I would advise to set good copyright and license even for private repos. You never know who can see what and when! – Maziyar Jan 11 at 16:16
6

Say I'm the only one uploading code to someone's private repository, do they own the copyright to the code? Or do I own the copyright to the code since I wrote it?

The author (or copyright holder) of the code "owns" the code, meaning you do. Where the code lives does not have much impact.

Now, if this is work you did "for hire" as an employee or contractor then in general the payer "owns" the rights. Code you created "for hire" becomes the property of the person that paid. This becomes a commercial or employment contractual matter, not an open source one per se, unless your agreement means that you are contributing code you have been paid to write under an open source license. This is not un-common case such as when companies are sponsoring FLOSS development.

Would adding a license stating that I own the code and the terms of usage suffice in this situation?

Yes, having an explicit license and copyright notice is always a good thing and it avoids confusion. I would also make sure that the owner of this private repository you are contributing to is well aware of the terms of your contribution, again to avoid confusion and misunderstanding.

/IANAL /TINLA

  • 1
    Your second paragraph is kind of shaky. In some jurisdictions, such as Canada, then your work under an employer doesn't always become theirs - unless you sign an explicit CAA. Otherwise, the code is not theirs, even when an implicit contract can be assumed. – Zizouz212 May 22 '16 at 19:10
  • 1
    @Zizouz212 let me reword and enhance this – Philippe Ombredanne May 23 '16 at 5:31
  • In the US, works made for hire must explicitly say so in a written contract. – chrylis -on strike- May 23 '16 at 13:27
  • @chrylis Thanks: I am definitely not a lawyer.... I updated the answer! – Philippe Ombredanne May 23 '16 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.