リポジトリのクローン
リポジトリのクローン
Sourcetree、ターミナルの Git、または任意のクライアントを使用して Git リポジトリをクローンできます。以下は、ターミナルから Git を使用してリポジトリをクローンする方法の手順です。
- リポジトリで、サイドバーの [クローン] をクリックして [クローン] ダイアログを表示します。リポジトリに投稿者ガイドラインがある場合、ガイドラインを読み、リポジトリへの投稿に必要な情報を確認します。
- Copy the clone command (either the SSH format or the HTTPS).
If you are using the SSH protocol, ensure your public key is in Bitbucket Data Center and Server and loaded on the local system to which you are cloning. - ターミナル ウィンドウで、リポジトリをクローンするローカル ディレクトリに移動します。
Bitbucket からコピーしたコマンドを貼り付けます。以下に例を示します。
HTTPS 経由でのクローン:$ git clone https://username@bitbucket.org/teamsinspace/documentation-tests.git
SSH 経由でのクローン:$ git clone git@bitbucket.org:teamsinspace/documentation-tests.git
If the clone was successful, a new sub-directory appears on your local drive. This directory has the same name as the Bitbucket repository that you cloned. The clone contains the files and metadata that Git requires to maintain the changes you make to the source files.
ミラー リポジトリのクローン
- Navigate to the repository in Bitbucket Data Center and Server.
- [クローン] ボタンをクリックします。
- ミラーが構成済みの場合、[クローン元] ドロップダウンを使用してもっとも近いミラーを選択します。これにより、クローン URL が変化します。
- クローン URL (SSH または HTTPS) をコピーします。
SSH プロトコルを使用している場合は、公開キーが正しく構成されていることを確認します。 - ターミナル ウィンドウを起動します。
- リポジトリのクローン先のローカル ディレクトリに変更します。
Enter
git clone
followed by the copied clone URL.
The command and clone URL together would look like this:$ git clone ssh://git@bitbucket-au.example.com:7999/upstream/PROJ/repo.git
If the clone was successful, a new sub-directory appears on your local drive. This directory has the same name as the Bitbucket repository that you cloned. The clone contains the files and metadata that Git requires to maintain the changes you make to the source files.