The is a single file source code that I have used as a base for my little project. That source code already works as it is.

The problem is its syntaxes, variable naming, spacing, and so many unused lines of code/variables. I consider it as bad and does not follow the conventions at all.

Now I have re-written the code and added some new features. The changes in the code are over 80%.

The source code that I used as a base is licensed Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License

According to the license, I can:

Share — copy and redistribute the material in any medium or format

This is what I am going to do.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

In this case, I will give a link back to the original repository/source code.

NonCommercial — You may not use the material for commercial purposes.

I will not sell it and will publish it as free.

NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

I don't understand this part. Why am I not allowed to distribute "modified material" when I can just "indicate if changes were made" as stated in the attribution.

I want to publish my re-written code with new features on GitHub with MIT license. Can I do it or will I encounter problems?

  • 3
    You should write your own version from scratch without referring to the old one. For example you could write test cases which exercise the first piece of code (the one you want to recreate), then without looking at that code, write your own version which passes the same test cases.
    – Brandin
    Commented Jul 6, 2019 at 16:59
  • 2
    It's not ambiguous. The reference to "indicate if changes were made" is redundant, but there are versions of this licence without the no derivatives part. Under this version of the license, you cannot distribute derivative works at all.
    – Kevin
    Commented Jul 7, 2019 at 23:23

1 Answer 1


I want to publish my re-written code with new features on GitHub with MIT license. Can I do it or will I encounter problems?

No, you can not publish your rewritten and extended code, because the CC BY-NC-ND license under which you received the original code does not give you permission to publish your changed code.

For reasons only known to the author of the original code, they chose to license their code under restrictive, non-open-source terms. As those are the terms under which you received the code, you have two choices: Either you play by the rules and use your version only for yourself, or you break the rules, break the law and risk that you have to defend yourself in a court of law. A possible outcome of a lawsuit is that you have to pay penalties and stop distributing your software. Given that you are asking about the license here makes that a reasonably likely outcome.

  • The base code is on GitHub, what if I just fork the repo, commit my own changes to my own forked repo, then keep the license as it is?
    – dcangulo
    Commented Jul 6, 2019 at 15:30
  • 2
    @DavidAngulo: That would only be permitted if you are using a private repository on GitHub. If you commit changes to a publicly accessible fork on GitHub, you are violating the CC BY-NC-ND license. The fact that others have the ability to download your changed version is already considered distribution. Commented Jul 6, 2019 at 15:48
  • 4
    @DavidAngulo It might be worth asking the original author instead if they’re willing to change the license, or give you another license for the code. The fact that you can fork non-open-source code on GitHub is a tad confusing, but that’s all you can do in this case - fork it. Anything else has to be done privately.
    – Tim Malone
    Commented Jul 7, 2019 at 1:23
  • @TimMalone, github has no (reasonable) way of knowing if what I upload is my scribblings, stuff I got legally from others, of code filched in the dark of the night. And if I got it legally, it might be that I can't distribute it further.
    – vonbrand
    Commented Feb 21, 2020 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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