DEV Community

Discussion on: Someone copied my code on Github and claimed it to be his own project.

Collapse
 
cicirello profile image
Vincent A. Cicirello • Edited

The answer to your question depends on the license that you applied to your work. Your post doesn't indicate, but since you have a relatively small number if GitHub repositories I took a look. Some of your repos have no license specified, some have the MIT license, and 1 the Apache license. Here's a bit of an answer for all 3 cases.

Case 1: no license specified.
Technically, if you have not specified a license, and have also not explicitly put the work into the public domain, then nobody but you can legally make a copy. Whether you have explicitly stated this anywhere or not, this case is essentially a copyright with all rights reserved. If this is your intention then it should probably be a private repository. People fork and clone public repos all the time including those without licenses stated. Many mistakenly think no license means public domain which it does not.

Case 2: MIT license.
This is an all-permissive license. It allows others to do almost anything with your code. They can copy it as is. They can use it in closed source commercial software. They can change it. They can give it away for free with or without changes. They can sell it with or without changes. And so on and so forth. The only requirement is that they keep the copyright notice and license notice in tact in any copies they distribute including in "substantial portions". However, they can redistribute it with or without changes under whatever license they want. The main purpose of requiring keeping the notice is so that others know how that portion was originally licensed. They can copy non-substantial portions without including your copyright notice and license notice.

With the MIT license, you should really also put your copyright and license notices at the top of each source file in a comment in addition to the license file in the repo. This way if someone uses one or more files but not entire repo, your copyright notice and license declaration stays with your code, unless they deliberately remove it. With only a license file you risk someone who only needs one of your source files separating those notices from your code accidentally with no ill-intention toward you or your work.

Case 3: Apache license.
One of your repos uses the Apache license. Like the MIT, this is all-permissive. There are a few differences but mostly allows others to use your code how they see fit. One of the differences is that the Apache requires that any changes to your code are identified so that others know that it was changed and how. The MIT doesn't require this although many do this anyway. You should read through it for other differences as well.

As with MIT, you should also put copyright notice at top of each source file, but not the full license (too long for that). Near bottom of Apache license there is an abridged notice that you should include in comment at top of each source file. The reason for including this in the source files is the same as before---to ensure that your copyright and license notices stay with your code if only part is reused.

An all-permissive license such as MIT or Apache is as close to putting something in public domain as it gets without actually doing so. In some countries, it is the closest you can get to putting something in public domain.

If you want to retain more rights to your work, then check out so-called copyleft licenses. The GPL 3.0 is the most common of these. With the GPL 3.0, those redistributing copies or derivative works must also license with GPL 3 in addition to keeping your notices. Essentially it keeps derivative works open source, whereas MIT and Apache do not.

Collapse
 
sadeedpv profile image
Sadeedpv🥇

I have made the repo private since yesterday, So I guess it shouldn't be a problem anymore. I appreciate that you took the time to look into the problem and thanks for your effort ❤️

Collapse
 
cicirello profile image
Vincent A. Cicirello

You're welcome. Before I saw your reply I added a paragraph to end of my comment on GPL license which has a copyleft requirement. Not sure if that may be useful to you or not.

Thread Thread
 
sadeedpv profile image
Sadeedpv🥇 • Edited

I don't have much idea about what copyleft concept is. Where can I read more on the topic?

Thread Thread
 
cicirello profile image
Vincent A. Cicirello

The short explanation of "copyleft" licenses is that if you apply a "copyleft" license to your code, then anyone who creates a derivative work from your code must apply the same license to their code. This implies that any derivatives of the derivative, etc also will have the same license. In essence, it keeps your code and anything derived from it open source. Whereas with an all permissive license like MIT, there is no such obligation on those who create derivatives (e.g., MIT licensed code can be used by others, including derivatives, in closed source software). In both cases, you are still the copyright owner, but you license away more of your rights with MIT or Apache than you do with the GPL and other "copyleft" licenses.

Here's a link that explains in more detail: gnu.org/licenses/copyleft.en.html

Collapse
 
philip profile image
Philip Kumah Jr

well not if he also posts it as he claims it be his.

Collapse
 
marvellous890 profile image
Ajayi Marvellous

Making the repo private doesn't solve the problem. He has already copied the code and I'm sure others have done the same, but you just saw that of his'. I think the solution is simply licensing. Thanks to Vincent A. Cicirello for clarifying all types of open source licences.

Collapse
 
williamhenderson profile image
William Henderson

This is not quite right - the GitHub terms state that by publicly making your code available on the service anyone has the right to fork your code, but if it does not have a licence, they cannot do anything with the forked code and it must remain linked to the source repo

Collapse
 
cicirello profile image
Vincent A. Cicirello

Thanks. I just edited my comment to remove the line about forking.

Collapse
 
polterguy profile image
Thomas Hansen

Incredibly good answer 😊💪

Collapse
 
incrementis profile image
Akin C.

Hello Vincent A. Cicirello and Sadeedpv,

First I want to thank you Sadeedpv for your article.
I realize it's more of a question than an article, but in my humble opinion you're raising a topic that feels underappreciated and underrepresented.

I would also like to thank you, A. Cicirello, for taking the time to share some clarificaton regarding licenses.