変更をコミットして Bitbucket Server にプッシュする
- Sourcetree をセットアップして Bitbucket Server と使用する
- Bitbucket Server で個人リポジトリを作成する
- リポジトリをクローンしてファイルをローカルで管理する
- 変更をコミットして Bitbucket Server にプッシュする
このステップでは、ステップ 3 でリポジトリに追加した HTML ファイルに変更を加えます。変更を行ってコミットしたら、それらを Bitbucket Server のリポジトリに追加できます。変更を行って完了するのではなく、ほかのユーザーとの共有を行いましょう。
変更を行う
このステップでは、ソース ファイルをローカルでコミットして個人リポジトリにプッシュできるよう、ファイルに単純な変更を加えます。
- Open the
Teams in Space.html
file in a text editor. Find the
<h3>Main Menu</h3>
line. Within that menu, add another list item to add a link to the itinerary on the main menu.
(You can copy this code and add it in your HTML file).<li id="menu-item-65" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-65"><a href="http://localhost:2431/?page_id=60">Moon Itinerary</a></li>
ファイルを保存します。
- Check your work by going to the
Teams in Space.html
file and opening it in a web browser. It should now look something like this.
変更のコミットとプッシュ
変更を行ってそれが動作することを確認したら、変更をコミットしてリポジトリにプッシュします。
- Sourcetree (またはコマンド ライン) を使用して変更をコミットします。
- From Sourcetree, click on Working Copy in the upper-left. In the Unstaged files pane on the bottom, you should see the
Teams in Space.html
file. - ファイルの左側のチェックボックスを選択します。ファイルが [ステージング済みのファイル] ペインに移動します。
- 左上の [コミット] をクリックします。下部でコミット ダイアログが開きます。
- テキスト フィールドにコミット メッセージを入力します (例: "最初のコミット")。
- From Sourcetree, click on Working Copy in the upper-left. In the Unstaged files pane on the bottom, you should see the
- 変更をリポジトリにプッシュします。
- 左側のブランチ フィールド内にはプッシュするための変更があることを示すインジケーターが、上部のツールバーにはプッシュ ボタンが表示されます。
- [プッシュ] ボタンをクリックし、master ブランチが選択されていることを確認して、[Ok] をクリックして変更をプッシュします。
- リポジトリに移動し、[コミット] をクリックして、変更がプッシュされたことを確認します。
- 左側のブランチ フィールド内にはプッシュするための変更があることを示すインジケーターが、上部のツールバーにはプッシュ ボタンが表示されます。
コマンド ラインから実行する
変更したファイルをコマンド ラインから個人リポジトリにコミットします。
ターミナル ウィンドウで次のように実行します。
cd website
git commit -m "Website changes"
git push -u origin master
最終更新日: 2021 年 2 月 2 日
Powered by Confluence and Scroll Viewport.