GitHub not recognizing auto-generated MIT license

To get a license file, I followed the steps below:

  • I clicked “Create new file” on the repo’s main page.
  • I named the file “LICENSE.txt”, then clicked on the “Choose a license template” button.
  • I chose the MIT license, clicked the “Review and submit” button.

I commited the exact output (not from the GitHub UI, I created the file locally and commited that) but GitHub doesn’t show the license in the repo header. It also doesn’t display the license summary when I open the file itself.

What can I do to make GitHub recognize my standard MIT license?

Hi there @safakgur,

That’s not cool, but I might be able to help you here. Does removing the  .txt extension help with this? :) 

Let me know.

Hi there, thank you for the answer.

I tried both removing the extension and adding a .md extension, neither worked.

Thanks for checking that, @safakgur.

Let’s see if removing the file locally > pushing the change to GitHub > creating the file using helps?

Just to make sure, when creating the filecopy this URL replacing the username/organisation, repository and branch with yours. Make sure to also press “Choose a license template” > MIT

If that doesn’t work, just let me know and I’ll see what else I can suggest :) 

1 Like

Thank you @timrossback, I just created a LICENSE file exactly as you suggested and removed the old LICENSE.txt using the GitHub UI. Still nothing changes. One thing to note is that I’m not doing these experiments on master. I’m on a branch called license. I tried changing my default branch to license, however and that didn’t help.

 Thanks for that @safakgur,

Would you be able to try creating a LICENSE file on the  master branch? If that doesn’t work, would you be able to try entering “Test Test Test” instead of “Şafak Gür” on line 3 of the license? :) 

Hi again, I didn’t want to touch the master branch of this repo so I’ve created a couple more to test. Turns out the license needs to be on the repo’s main branch but it’s ok for the main branch to be different than master. I thought I tested this case yesterday but apparently I did something wrong.

So it works with the license file I created and committed using the GitHub UI but not when I copy that license to a local file and commit+push from there. I wonder whether the files were the same, i.e. if there were some invisible differences like different line endings.

I’ll do a byte by byte comparison when I can, thank you for the suggestions.

1 Like

Ah, that’s great news @safakgur! I’m so glad you got it sorted.

I’d also really suggest you also reach out to the folks over at GitHub support. They’ll be able to have a look backstage and see why this has happened (so it doesn’t happen again!) You can get in touch with them over here: :) 

If you need a hand with anything, just let me know - I’m here for you.

1 Like

Hello, I have the same issue here*;  did everything mentionned; move ; delete ; create. May we have a gitattribute for that?