Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 8

GitHub not recognizing auto-generated MIT license

Solved! Go to Solution.

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?

7 Replies
Pilot Lvl 3
Message 2 of 8

Re: GitHub not recognizing auto-generated 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.

Highlighted
Copilot Lvl 3
Message 3 of 8

Re: GitHub not recognizing auto-generated MIT license

Hi there, thank you for the answer.

I tried both removing the extension and adding a .md extension, neither worked.
Pilot Lvl 3
Message 4 of 8

Re: GitHub not recognizing auto-generated MIT license

Thanks for checking that, @safakgur.

 

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

 

Just to make sure, when creating the file copy 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 :) 

Copilot Lvl 3
Message 5 of 8

Re: GitHub not recognizing auto-generated MIT license

Thank you @ItsPugle, 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.

Solution
Pilot Lvl 3
Message 6 of 8

Re: GitHub not recognizing auto-generated MIT license

 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? :) 

Copilot Lvl 3
Message 7 of 8

Re: GitHub not recognizing auto-generated MIT 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.

Pilot Lvl 3
Message 8 of 8

Re: GitHub not recognizing auto-generated MIT license

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: https://github.com/contact :) 

 

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