0
は、それを初期化した後、私は別の名前の枝を作成する前に、まずmasterブランチにコミットする必要がありますか、または私が行うことができます。Mercurialでは分岐前にマスターブランチにコミットする必要がありますか? Mercurialのリポジトリと
hg init
hg branch develop
、その後の前に、開発ブランチにコミットいくつかの段階の合併がマスターに発展する。
は、それを初期化した後、私は別の名前の枝を作成する前に、まずmasterブランチにコミットする必要がありますか、または私が行うことができます。Mercurialでは分岐前にマスターブランチにコミットする必要がありますか? Mercurialのリポジトリと
hg init
hg branch develop
、その後の前に、開発ブランチにコミットいくつかの段階の合併がマスターに発展する。
Mercurialには、実際にはマスターブランチの概念がありません。それらはすべて等しく、すべてのhgチェンジセットは1つだけのブランチに属します。最初のブランチの名前をdefault
とするの規則があり、そのブランチは新しいブランチを作成するまで使用されますが、その名前は使用する必要はありません。あなたのケースでは、最初のコミットがdevelop
という名前のブランチに対して行われているので、後で作成してコミットするまで、default
を含む他のブランチ名は存在しません。
$ hg init
$ hg branch develop
marked working directory as branch develop
$ touch a
$ hg add
adding a
$ hg commit -m 'on develop'
$ hg branches
develop 0:f0170c7bcdcf
$ hg branch default
marked working directory as branch default
$ touch b
$ hg add b
$ hg commit -m 'on default'
$ hg branches
default 1:0668d80655ff
develop 0:f0170c7bcdcf (inactive)
$ ls
a b
$ hg update develop # change working directory back to develop branch
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ ls
a
:
branch
コマンドを使用して
$ hg init
$ hg branches
$ touch a
$ hg add
adding a
$ hg comm -m 'initial commit to default'
$ hg branches
default 0:c3eac81383bd
:
分岐命令を使用せず