I have a simple MIT licensed project and need to include a about 10 lines of GPL3 code (some math stuff that needs to be the same). I know that i need to change the license of my project, give credit to the author and indicate changes made to the code. Is a simple comment with a github link to the code enough?


  • Which bits of Sections 4 and 5 of the GPL are you having difficulty understanding? Jun 13 at 19:20
  • The question was if it's enough to add a comment with the source. 5a says: "notices stating that you modified it, and giving a relevant date"
    – user27204
    Jun 13 at 19:42
  • you missed all the parts which basically sum-up to "also use GPL, if you want to include parts of this". There is no way you can include GPL-licensed code into a permissively licensed project without explicit consent by ALL contributors to the GPL-licensed code allowing you to re-license it. Jun 14 at 10:59

1 Answer 1


The attribution, IMHO independent of the license, should be done in the usual manner.

State the copyright at the header of the file(s) or, if it is only a tiny part in a big file, you can also add or move their copyright statement to the documentation of the function.

Additionally you will want to amend the public copyright notice of your programme by theirs, indicating that parts (possibly which part) is their copyright. If you modify the borrowed function you can indicate that by describing it as "functionality XXX based on work by..." or "...derived from work by...". You could also structure your credits in a similar way like OpenTTD with sections on current team, retired team and 'thanks to' where people are listed with significant one-time contributions (of whatever kind).

But the most important take-away here is: If you work in good faith to ensure that people (users and developers) can know who contributed what, you will be fine. Just communicate clearly to your users from whom you took code, and acknowledge that. If you maintain a VCS reasonably, and add a copyright message to files or functions, then the changes you made to the original code are readily documented.

All this IMHO is good practice also for permissive licenses like the MIT.

That said, and as you acknowledge yourself, you cannot legally include GPL-licensed code into your MIT (or other permissively-licensed) code-base. I really appreciate that you mind this difference as the GPL goes quite a bit beyond the requirements of the permissive licenses; it's a strong copyleft license, and often chosen on purpose. Additional to the requirement to credit the copyright holders as outlined above, the GPL requires, that ALL code derived from it is also offered to the recipients of the software under terms of the GPL or similar conditions. Thus, if you would want to include GPL-licensed code into an MIT-licensed codebase, you would have to approach the authors of the GPL-licensed code and get a special license where each allows you to release their code under MIT.

  • 1
    My reading of the question, in particular "I know that i need to change the license of my project", is that the OP is aware of this issue. Jun 14 at 12:02
  • 1
    @PhilipKendall hm, indeed.. more coffee, I totally missed that. Thanks for the pointer. I shall adopt my answer Jun 14 at 12:26

Your Answer

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