I found a certain repository on GitHub that contains a LICENSE.txt file with an MIT license dated 2014, but in one of the source files, the top of the file contains an Apache 2.0 license dated 2013.

This specific instance isn't that important, it's just illustrating my question, but what sort of implications does this have for licensing? Does the license on individual files override the license placed on the whole project? Does the date on the license have any effect?

  • Not a lawyer, but I would take this to mean that the files are under the "repo license" unless it has a specific license embedded into the file.
    – RubberDuck
    Jun 9, 2015 at 11:41
  • No @DocBrown. I think you are correct. You just failed to mention that only the files that have licenses embedded into them would be dual licensed.
    – RubberDuck
    Jun 9, 2015 at 11:56
  • @RubberDuck: opposed to what you wrote in your first comment, I would not expect files with an embedded license not beeing also under the "repo's license". I would expect that both licenses apply, and one has to follow the terms of both licenses for those files in stake. In this specific case, this may indeed mean to follow the terms of the Apache license, but that's not true in general.
    – Doc Brown
    Jun 9, 2015 at 12:06
  • That's exactly what I meant @DocBrown. I apologize for not writing an answer in the comments.
    – RubberDuck
    Jun 9, 2015 at 12:10
  • In practice, it practically always means that the person changed the license in one place, but forgot to make the change in other places. As simple as that. The legal implications of that is indeed a different (and perfectly valid) question. Jun 9, 2015 at 12:13

1 Answer 1


You can indeed have more than one license in place, at the same time, and either give the user of the code some freedom to pick the license he likes best (see dual- or multi-licensing on Wikipedia), or require him to obey the terms of both licenses, as long as they do not contain contradicting requirements.

A popular model is to have one license for a "work as a whole" (containing many source files), and different licenses for individual source code files, as long as the license for the individual source file is more permissive than the license for the work as a whole. For example, the GPL is a license where the text explicitly mentions it applies to the "work as a whole". That is why the Linux kernel is under GPL, but some kernel modules contain files which are under MIT or a modified BSD license. So as long as you use or publish those files individually, and not as part of the Linux kernel, you only have to follow the terms of the MIT or BSD license.

In your specific case, I would expect the MIT license has to be applied to the "work as a whole", and the combined MIT & Apache 2.0 for the files which contain the Apache license. The latter one is - at least slightly - less permissive than the MIT license. For example, the Apache license requires you to mention changes to the original code. IANAL, but such a term does not seem to contradict the MIT license. For example, when you change the file with the Apache license embedded, I would expect you have to mention those changes. When you change a different file, I would expect you are not required to do so. There are more differences between the two like a patent clause in the Apache license which is not part of the MIT license. So what you will actually have to check is if your intended usage of the code confirms to both licenses. And if you are not sure, ask a lawyer.

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.