はつねの日記

Kinect, Windows 10 UWP, Windows Azure, IoT, 電子工作

GitHubのmasterブランチはmainブランチ?

[JP]The English translation is next to the Japanese. Please scroll down.

GitHubのmasterブランチはmainブランチ

GitHubのmasterブランチは、そのソースコードの大元のブランチです。

git-flowなどの流儀では、masterブランチは直接変更せず、developブランチを切って、更に変更内容ごとにfeatureブランチを切り、そこで変更が終わったらdevelopブランチにマージして、さらにリリースするときにはreleaseブランチにマージしリリース作業をします。

そして、リリースしたらreleaseブランチから、masterブランチとdevelopブランチにマージしてみたいな感じにします。

 

もちろん、ここでいう「master」は、masterディスクとかmasterファイルとかと同じ意味の「master」です。

マスターファイルは日本語で言えば、原簿とか基本ファイルと呼ばれているので(というかマスターファイルで通じるけどね)、あえて、masterブランチを日本語化するならば、原分岐とか基本分岐とかになるのでしょうか。

 

それくらい大切なmasterブランチですが、最近の流れでは「master」ではなく「main」と命名することがあるようです。

例:

github.com

これ、docsの方はmasterブランチで引用していて、ことごとくリンクが404になってしまうので、最近変わったようです。

 

EssentialsのShareのdocsで気づいてプルリクしたけど、これ、shareだけじゃなくて、Essemtials関係のdocs全部ですね。

docs.microsoft.com

ほぼすべてのページで、最後にAPI Source codeでgithubのmasterブランチを引用しています。

 

「main」ブランチでもいいといえばいいのですが、この「master」は、master/slaveのようなslaveと対をなすものではないので、そのままでもいいような気もしなくもないです。でも、masterからmaster/slave想像しちゃうっていうのならば変えるのがいいのかな(この部分を議論したい訳じゃないので、深追いをするつもりないです)。

ただ、私見ですが、先ほどの日本語訳からの逆翻訳した「original」ブランチの方が「main」ブランチよりもしっくりくるかなー。

あとは、「base」ブランチとかかな。

 

[EN]

From now on, will the master branch on GitHub be called the main branch?

The master branch on GitHub is the main branch in its source code.

In the "git-flow" style, you don't change the master branch directly, but instead use the develop branch, and then cut a feature branch for each change, where the change is done, and then and merge it into a develop branch, and release it when you release more. branch and work on the release.

Then, when you release, you merge them into the master branch and the develop branch from the release branch, and so on.

 

Of course, the "master" here is the same as the master disk and the master file.
In Japanese, the master file is called "original file" or "basic file", so if you were to Japaneseize the master branch, it would be "original branch" or "basic branch". 

 

Although the master branch is that important, it is sometimes called "main" instead of "master" in recent years.

For example:  

github.com

 This seems to have changed recently, as the docs are quoted in the master branch, and the links are 404 at every turn.

 

I noticed this in the Share docs in Essentials and pulled it, but it's not just share, it's all the Essemtials-related docs, not just share. 

docs.microsoft.com

Almost every page cites the master branch of github in the API Source code at the end.

 

I wish I could say that the "main" branch is fine, but the "master" is the master It's not a counterpart to a slave like /slave, so I think it's fine as is. It's not impossible. But if you're going to imagine master/slave from master, then changing it is a good idea.

If you're going to imagine master/slave from master, I'd change it (I'm not trying to argue this part, so I won't pursue it).

But in my opinion, the "original" branch, back-translated from the Japanese translation above, feels better than the "main" branch.

Then there's the "base" branch and so on.