Bitbucket でリポジトリから変更をプルする
宇宙ステーションの管理アクティビティにおける次の作業として、新しい物資のリクエストを登録する必要があります。Bitbucket 宇宙ステーションに物資を送るためのシステムをセットアップしましょう。Bitbucket と Sourcetree の知識があと少しあるだけで、今後数年にわたって宇宙探索をサポートできます!
ステップ 1. Bitbucket でのファイルの作成
サプライ リクエスト ファイルを追加するには、以下の操作を行います。
From your BitbucketStationSupplies in Bitbucket, select Source to open the source directory.
ディレクトリには
supplies.txtファイルのみが表示されます。
A. Source page: Select the link to open this page.
B. ブランチの選択: 表示するブランチを選択します。
C. More options button: Select to open a menu with more options, such as 'Add file'.
D. ソース ファイル領域: Bitbucket のディレクトリまたはファイルを表示します。
2. From the Source page, select the More options button in the top right corner and select Add file from the menu. The More options button only appears after you have added at least one file to the repository.
A page for creating the new file opens, as shown in the following image.
A. 新しいファイルのブランチ: 別のブランチにファイルを追加する場合は変更します。
B. 新しいファイル領域: ここに、新規ファイルのコンテンツを追加します。
3. ファイル名フィールドに supplyrequest と入力します。
4. [構文モード] リストから [HTML] を選択します。
5. テキスト エリアに次の HTML コードを追加します。
<p>We are requesting additional supplies. Please send us the following:</p>
<ul>
<li>space ice cream</li>
<li>nerf darts</li>
<li>telescope light shield</li>
</ul>6. Select Commit. The Commit message field appears with the message: supplyrequest 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. リモートリポジトリから変更をプル
次に、そのサプライ リクエスト フォームをローカル システムに送る必要があります。プロセスは非常にシンプルで、基本的に、supplies.txt ファイルを Bitbucket に送る際のプッシュと反対の操作になります。
ファイルをローカル リポジトリにプルするには、次の操作を実行します。
Open your repository in Sourcetree, and select the Pull button.
Bitbucket からローカル リポジトリへのファイルのマージを示すポップアップが表示されます。
Select OK from this box. Sourcetree updates with a description of the merged file.
ローカル システムのリポジトリ フォルダに移動すると、追加したばかりのファイルが表示されます。
おめでとうございます!これで、Bitbucket とローカル システム間の基本的な DVCS ワークフロー (クローン、追加、コミット、プッシュ、プル) を終了しました。
この内容はお役に立ちましたか?