How to add license to an existing GitHub project
Asked Answered
A

5

387

When I created a GitHub project I chose None.

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

screenshot

Astute answered 26/7, 2015 at 16:4 Comment(1)
Second title from the bottom: help.github.com/articles/open-source-licensingParris
T
447
  1. In your repository, click 'Create new file'

step 0


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.

step 1


  1. Choose your preferred license.

step 2

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.

Testis answered 18/6, 2016 at 9:56 Comment(3)
As a bonus, the license will now be displayed in the upper right part of the page, after the number of contributors.Preterition
So it is! Good feature. Probably not on-topic enough to include in my answer, but thanks for highlighting it.Testis
Note that the most common file name is simply LICENSE, while LICENSE.txt and LICENSE.md are less common file names.Jackstraws
S
378
  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 after which a license picker will show up. Then you can choose the type of license.
Stirk answered 28/7, 2015 at 3:28 Comment(0)
C
108

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

add license to github repository

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

Cherish answered 23/9, 2018 at 13:35 Comment(2)
This is better and easier approach than other answers. Should have been marked as "Accepted" in my view.Narda
This is now under Community Standards.Katusha
C
11
  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)
Cowage answered 3/8, 2016 at 7:19 Comment(0)
P
2

I just wanted to add another valid alternative using https://choosealicense.com made by Github and many more.

ChooseALicense.com aims to provide accurate, non-judgmental, and understandable information about popular open source licenses in order to help people make informed decisions about the projects they start, maintain, contribute to, and use.

After you have picked your license there are two alternative ways to transfer your new license.

  1. Copy to clipboard: Click button Copy license text to clipboard and paste into your LICENSE file anywhere you want. How to add license into Github is answered by others.
  2. Github: Fill textfield Enter GitHub repository url and hit Enter (Bellow the button). You will be asked for permission to access your Github repository.

Note!

Create a text file (typically named LICENSE or LICENSE.txt) in the root of your source code and copy the text of the license into the file. Replace [year] with the current year and [fullname] with the name (or names) of the copyright holders

Example https://choosealicense.com/

Partlet answered 15/10, 2021 at 3:12 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.