iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
💮

How to Set Up Creative Commons Licenses for GitHub Repositories

に公開
8

When creating a GitHub repository in a web browser, you can set various open-source licenses using the "Choose a license" field.

choose-a-license.png

However, "free licenses" other than open-source licenses cannot be set there. This article introduces how to manually set CC Licenses for a GitHub repository.

The license for a GitHub repository can be specified in a LICENSE file directly under the repository root. Therefore, we will set the legal code of the CC Licenses as the LICENSE file.

Text versions of the CC Licenses legal code can be obtained from the following links:

Rename the obtained text file to LICENSE, place it in the repository root, and commit & push. This will make the repository's web display look something like this:

about-repository.png

For example, while Zenn does not have a feature to set a license for articles, it is possible to set a license for the GitHub repository itself.
By the way, I have applied a CC BY-SA license to the repository for my articles here.

Please note that CC Licenses are not tuned for program code. If you wish to grant permission for the use of program code under a "free license," I strongly recommend applying an open-source license.

[Addition] Markdown Format License Files

It seems some people provide the CC Licenses legal code in Markdown format.

You can probably take the file from there and place it with the name LICENSE.md. However, GitHub doesn't seem to interpret these files, so the license type may not be displayed on the repository's web interface.

Still, it's true that Markdown is more human-readable. If anything, you could also use Shields.io to create a badge.

References

GitHubで編集を提案

Discussion

Tsuyoshi CHOTsuyoshi CHO

種別表示はできないようですが、代りに見易いMarkdownの表示がしたいなら
https://github.com/idleberg/Creative-Commons-Markdown
からもってくることも可能です、参考まで。
https://github.com/tsuyoshicho/zenn-articles-and-books/blob/master/LICENSE.md

SpiegelSpiegel

情報ありがとうございます。遅くなりましたが,記事に追記しました。

Tsuyoshi CHOTsuyoshi CHO

(更新は不要かもです)
Markdownの方ですが、ライセンス認識されるようになっています。
いつからかは不明ですが、けっこう前からです。
最近こちらの記事を再読したのでコメントしておきます。

SpiegelSpiegel

情報ありがとうございます。ひとこと追記しておきました。

Tsuyoshi CHOTsuyoshi CHO

ありがとうございます。一応Qiitaにあったやつですが、正式表示できる意味ではあったほうがいい情報だろうとは思っていたので、のせてもらってすみませんw。

ポジTAポジTA

情報ありがとうございます。
LicenceをCC BY-SA 4.0にしたかったので、すごく役に立ちました。

README.mdを参考にさせていただきました。
かなり細かいところなんですが、
Repogitory for https://zenn.dev/spiegel (powered by Zenn)
RepogitoryRepositoryかと思います!

SpiegelSpiegel

おおっ,ホンマじゃ!

ありがとうございます。修正しました。

ポジTAポジTA

少しでもお礼ができてよかったです。
こちらこそありがとうございました。