How to add license to an existing GitHub project

别来无恙 提交于 2019-12-20 08:22:33

问题


When I created a GitHub project I chose None.

How can I now add a GPL license to my already added project?


回答1:


  1. Go to your repository
  2. Add a new file by clicking the blue plus icon
  3. Type the file name as License.txt or License.md so license picker will show up..then you can choose the type of license



回答2:


  1. In your repository, click 'Create new file'


2. a) Type 'LICENSE', 'LICENSE.md' or 'LICENSE.txt' as the new file's file name. b) The 'Want to use a new template?' dialog will appear.


  1. Choose your preferred license.

The accepted answer is almost there, but confused me, because it said 'click the blue plus' - the interface may have changed - and the image is the same as the OP's.




回答3:


There is an easier way to get to the 'Add License' wizard:

  • Go to your repository's Insights tab
  • Click Community on the left side
  • On the right side, click Add on the line wich says License

For some reason this is not even mentioned in the docs at github.




回答4:


  1. Go to your repository
  2. Click on "Create new file" Button
  3. Type the file name as License.txt or License.md in the input box next to your repository name, a drop down button appears towards right side
  4. Choose the type of license of your choice
  5. Click "Commit new file" button at the bottom (Green button)



回答5:


If you later wanna add the shield to the readme.md You can use shields.io for en extra touch.

Cheers!




回答6:


I would suggest you to try reading about the various licenses to choose the best that suits you.
Check out this choosealicense.com it defines each license properly.
You can then see entire license by clicking on the one you want then copy the license Like this and paste it in your LICENSE.txt.



来源:https://stackoverflow.com/questions/31639059/how-to-add-license-to-an-existing-github-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!