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 で Git リポジトリから変更をプルする

宇宙ステーションの管理アクティビティの次の作業として、場所の詳細情報を含むファイルが必要です。この時点では場所の数があまりないため、Bitbucket から直接追加することになります。

ステップ 1. Bitbucket でのファイルの作成

新しいロケーション ファイルを追加するには、以下の操作を行います。

  1. From your BitbucketStationLocations repository, select Source to open the source directory.
    Notice you only have one file, locations.txt, in your directory.

  2. Select Source.

  3. Select the branch you want to view.

  4. Select the More actions () button, then Add file. This button only appears after you have aded at least one file to the repository.

  5. View the director of files in Bitbucket in the Source file area.

A page for creating the new file opens, which includes:

  • Branch with new file: Change if you want to add file to a different branch.

  • New file area: Add content for your new file here. 

3. [ファイル名] フィールドに「stationlocations 」と入力します。

4. [構文モード] リストから [HTML] を選択します。
5. 次の HTML コードをテキスト ボックスに追加します。

<p>Bitbucket has the following space stations:</p> <p> <b>Earth's Moon</b><br> Headquarters </p>

6. Select Commit. The Commit message field appears with the message: stationlocations created online with Bitbucket.

7. Select Commit under the message field.

これで、Bitbucket に新しいファイルができました。コミットの詳細を示すページが開いて、先ほど行った変更を確認できます。

画像: コミットされた新規ファイル

If you want to see a list of the commits you've made so far, select Commits in the sidebar.

ステップ 2. リモートリポジトリから変更をプル

次に、この新規ファイルをローカル リポジトリに送る必要があります。プロセスは非常にシンプルで、基本的に、locations.txt ファイルを Bitbucket に送る際のプッシュと反対の操作になります。

ファイルをローカル リポジトリにプルするには、次の操作を実行します。

  1. ターミナル ウィンドウを開き、ローカル リポジトリの最上位に進みます。

    macOS / Linux / Git Bash
    $ cd ~/repos/bitbucketstationlocations/

    Windows コマンド プロンプト
    $ cd repos/bitbucketstationlocations/

  2. git pull --all コマンドを入力して、Bitbucket からすべての変更をプルします (より複雑なブランチ作成ワークフローでは、すべての変更のプルやパージが適さない場合があります)。要求されたら Bitbucket パスワードを入力します。ターミナルは次のようになるはずです。

    $ git pull --all Fetching origin remote: Counting objects: 3, done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From https://bitbucket.org/emmap1/bitbucketstationlocations fe5a280..fcbeeb0 master -> origin/master Updating fe5a280..fcbeeb0 Fast-forward stationlocations | 5 ++++++++++++++ 1 file changed, 5 insertions(+) create mode 100644 stationlocations

    git pull  コマンドは、リモート リポジトリ (Bitbucket) のファイルを 1 つのコマンドでローカル リポジトリにマージします。

  3. ローカル システムのリポジトリ フォルダに移動すると、追加したばかりのファイルが表示されます。

素晴らしい!宇宙ステーションの場所に関する 2 つのファイルを追加することで、Bitbucket とローカル システム間の基本的な Git ワークフロー (クローン、追加、コミット、プッシュ、プル) を実行しました。

次へ

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

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