Bitbucket is getting a new navigation

We’re rolling out these changes, so the documentation may not match your experience in the Bitbucket Cloud app. Read about the new Bitbucket navigation

リポジトリのブランチまたはフォーク

Bitbucket Cloud リポジトリから複数の方法でコードを取得して、プロジェクトで作業できます。それぞれの方法はわずかに異なり、別の目的のために実行されます。  

ブランチ、フォークとは

Branching and forking provide two ways of diverging from the main code line. Both Mercurial and Git have the concept of branches at the local level. A repository code branch, like a branch of a tree, remains part of the original repository. The code that is branched (main trunk) and the branch know and rely on each other. Like a tree trunk's branch, a code branch knows about the trunk (original code base) it originated from.

フォークは、クローンまたはコピーの別の呼び名です。フォークというプログラミング用語は、既存のプロセスのコピーを作り出す Unix のシステム コールからの派生です。そのため、ブランチとは異なり、フォークは元のリポジトリから独立しています。元のリポジトリが削除されても、フォークは残ります。リポジトリをフォークすると、そのリポジトリおよびそのブランチがすべて取得されます。

DVCS ホスティングの進化とともに、フォークという用語も変化しました。Bitbucket ソフトウェアはフォークの管理機能を導入しています。Bitbucket のリポジトリのフォークには、シンプルな DVCS でのクローンでは通常利用できない機能があります。たとえば、Bitbucket では、フォークの元となるリポジトリを常に確認できます。これは、ローカル システム上の DVCS クローンでは行なえません。

ブランチとフォークの比較

Whether you use either branching or forking, and to what extent, depends on your working environment. There are lots of ways colleagues can work with and combine fork and branch functionalities. You can google for discussions about this. Generally, for hosted systems, forks work well in situations where, as a repository admin:

  • リポジトリでのユーザー アクセスを管理したくない。 

  • マージを細かく制御したい。

  • 個別ブランチをサポートしたい。

  • 実験と変更を容易に破棄したい。

We recommend branching for development organizations on Bitbucket; We use a modified form of Vincent Driessen's GitFlow technique. Bitbucket branches are useful when:

  • 互いに信頼し、緊密にコミュニケーションをとっているプログラマーの小規模なグループがある。

  • 開発組織にリポジトリへの書き込みアクセス権限を与えたいと思っている。

  • 短時間の反復サイクルがある。

Bitbucket はブランチとフォークの両方をサポートしているため、用途に応じて自由に選ぶことができます。

リポジトリのフォークまたはブランチのクローン

プロジェクトでファイルを更新したり新しいファイルを追加したりして作業したい場合、お使いのマシンまたはローカル ネットワーク上にリモート Bitbucket リポジトリのローカル クローンを作成する必要があります。これを実行するには、Bitbucket リポジトリの [クローン] ボタンを使用します。リポジトリをフォークした場合は、単純にフォークをクローンします。リポジトリのブランチを作成した場合、リポジトリをクローンしてブランチをチェックアウトします。

Read about how to clone a Bitbucket repository.

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。