リポジトリのクローン
Cloning a repository
Sourcetree、ターミナルの Git、または任意のクライアントを使用して Git リポジトリをクローンできます。以下は、ターミナルから Git を使用してリポジトリをクローンする方法の手順です。
- From the repository, click Clone in the sidebar to display the Clone dialog. If there's contributor's guidelines available for the repository, have a look to make sure you're onboard with what's expected for contributions to the repository.
- clone コマンドをコピーします (SSH または HTTPS 形式)。SSH プロトコルを使用している場合、公開キーが Bitbucket に追加されていて、クローンを行うローカル システムに読み込まれていることを確認します。
- ターミナル ウィンドウで、リポジトリをクローンするローカル ディレクトリに移動します。
Bitbucket からコピーしたコマンドを貼り付けます。以下に例を示します。
HTTPS 経由でのクローン:$ git clone https://username@bitbucket.org/teamsinspace/documentation-tests.gitSSH 経由でのクローン:$ git clone git@bitbucket.org:teamsinspace/documentation-tests.git
クローンが成功すると、ローカル ドライブに新しいサブディレクトリが表示されます。このディレクトリは、クローンした Bitbucket リポジトリと同じ名前になります。クローンには、ソース ファイルへの変更を保持するために Git が必要とする、ファイルとメタデータが含まれます。
Cloning a mirror repository
You can use Sourcetree, Git from the terminal, or any client you like to clone your Git repository. These instructions show you how to clone a mirrored repository using Git from the terminal. Read more about Smart Mirrors.
- Bitbucket のリポジトリへ移動します。
- [クローン] ボタンをクリックします。
- If mirrors are configured, use the Clone from dropdown to select the mirror closest to you–the clone URL changes.
- Copy the clone URL (either SSH or HTTPS).
If you are using the SSH protocol, ensure your public key is correctly configured. - Launch a terminal window.
- Change to the local directory where you want to clone your repository.
Enter
git clonefollowed 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
クローンが成功すると、ローカル ドライブに新しいサブディレクトリが表示されます。このディレクトリは、クローンした Bitbucket リポジトリと同じ名前になります。クローンには、ソース ファイルへの変更を保持するために Git が必要とする、ファイルとメタデータが含まれます。
