I would like to use some code from an MIT-licensed project I don't own (let's call it project A), in a project (B) with a different license. It is my understanding that I can do whatever I want with this MIT-licensed code, as long as the license and attribution stay with the code.
In this case, the license is in a file at the root of project A's repository. Is it OK to copy a file from project A to project B, and add the license's content in a header in this file, instead of keeping it as a separate file? Do I have to keep the license file somewhere instead, and if I do, how should I specify which files in the project are under this license? Is a link to the original repository/license added at the top of the copied file enough?