Creating a new license file in github
To create a new license file in GitHub, you can follow these steps:
Step 1: Create a new file
- Log in to your GitHub account and navigate to your repository.
- Click on the "Create a new file" button in the top right corner of the repository page.
- In the "Create a new file" dialog box, enter the name of your license file, for example, "LICENSE".
- Click on the "Create file" button.
Step 2: Add the license text
- In the new file, add the text of your chosen license. You can copy and paste the text from a license template or write it yourself.
- Make sure to include the following information:
- The name of the license (e.g., "MIT License")
- The copyright holder (e.g., "Your Name")
- The date of the license
- Any specific terms or conditions of the license
- Save the file.
Step 3: Commit and push the changes
- Commit the changes to your local repository using the command
git add.
andgit commit -m "Added license file"
(replace the commit message with a meaningful one). - Push the changes to your remote repository using the command
git push origin master
(assuming your repository is named "master").
Step 4: Update your repository settings
- Go to your repository settings by clicking on the gear icon in the top right corner of the repository page.
- Click on "Licenses" in the left-hand menu.
- Select the license file you just created from the dropdown menu.
- Click on the "Save" button.
That's it! Your new license file is now associated with your repository.