リポジトリのクローン

Cloning a repository

Sourcetree、ターミナルの Git、または任意のクライアントを使用して Git リポジトリをクローンできます。以下は、ターミナルから Git を使用してリポジトリをクローンする方法の手順です。

  1. 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.
  2. 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.
  3. ターミナル ウィンドウで、リポジトリをクローンするローカル ディレクトリに移動します。
  4. 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.

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


  1. Navigate to the repository in Bitbucket Data Center and Server.
  2. [クローン] ボタンをクリックします。
  3. If mirrors are configured, use the Clone from dropdown to select the mirror closest to you–the clone URL changes.
  4. Copy the clone URL (either SSH or HTTPS).
    If you are using the SSH protocol, ensure your public key is correctly configured. 
  5. Launch a terminal window.
  6. Change to the local directory where you want to clone your repository.
  7. 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.

最終更新日 2022 年 8 月 18 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.