> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/devops/devops-ja/kdo/buranchi/sumtomjino.md).

# スマートマージの使用

{% hint style="warning" %}

#### 旧UI向けに作成

この記事は旧UI向けに作成されました。手順は今でも使用できますが、スクリーンショットは古くなっています。場合によっては、手順で参照されている項目が移動または変更されていることがあります。項目が見つからない場合は、 [どこに行ったのか](/devops/devops-ja/shii-uiux-heno/dokonittanoka.md) 記事。
{% endhint %}

## ![](https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FG5ZbxX918xOHwbAwAJ4n%2FSummary2-Small-Icon.svg?alt=media\&token=da26a67f-ff7f-47b3-8669-06be960dc2d7) 概要

DevOps では、Smart Merge を使用すると、ソースブランチからターゲットブランチへ変更をすばやくマージできます。この記事では、Smart Merge の実行方法を手順ごとに説明します。ここで説明する手順には、競合する変更を含む Smart Merge は含まれていません。競合の解決方法については、次の記事を参照してください。

* [スマートマージの競合の解決](/devops/devops-ja/kdo/buranchi/sumtomjinono.md)

{% hint style="info" %}

#### Smart Merge と Pull Request の比較

Smart Merge と Pull Request はどちらも、ソースブランチからターゲットブランチへ変更をマージしますが、それぞれ異なるワークフローに適しています。

**Smart Merge** は、Pull Request やチームの承認を必要とせず、ブランチ間で変更を直接マージする、簡潔な 1 ステップのプロセスです。緊急の修正や、迅速なリリースが必要な重要な変更など、時間的制約のある状況に適しています。

1つの **Pull Request**は対照的に、チームでの共同作業のために作られた、構造化された複数ステップのプロセスです。複数のレビュー担当者が変更を確認し、修正を依頼し、マージする前に正式に承認できます。

一般的な目安として、変更に他のチームメンバーによる確認や承認が必要な場合は Pull Request を使い、変更を素早く統合する必要がある場合は Smart Merge を選びます。
{% endhint %}

Pull Request について詳しくは、次の記事を参照してください。

* [プルリクエストの概要](/devops/devops-ja/pururikuesuto/pururikuesutono.md)

## Smart Merge を実行

{% stepper %}
{% step %}

### ソースブランチを選択して Smart Merge を実行

1. 次をクリックします **コード** を左側のサイドバーメニューから。
2. マージのソースブランチとして使用するブランチを一覧から選択します。

   <div align="left"><figure><img src="https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FrKUpxKRuETJK7nFbWdHZ%2FUsingSmartMerge-S01-01.png?alt=media&amp;token=7ed3383a-d3a1-45a6-b7a3-041ebc1cb609" alt="" width="563"><figcaption></figcaption></figure></div>
3. 次をクリックします **縦三点 ⋮** のドロップダウンメニューをデプロイの横で開きます。
4. 次をクリックします **Smart Merge**.

   <div align="left"><figure><img src="https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FOZsUODLrFCPo2Rz5pflf%2FUsingSmartMerge-S01-02.png?alt=media&amp;token=7cac0837-eee2-4931-a574-3607113cfca8" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### ターゲットブランチを選択

1. 次をクリックします **次を選択** マージのターゲットにしたいブランチとして
2. 次をクリックします **次へ**.

   <div align="left"><figure><img src="https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FlTYWftE0aA7jW9t7YVyX%2FUsingSmartMerge-S02-01.png?alt=media&amp;token=e42245b2-e92b-46c6-a3d4-5eacd43af3ef" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### 競合を解決

ターゲットブランチを選択すると、Smart Merge は 2 つのブランチを比較し、自動的にマージできない変更を特定します。チェックが完了すると、そのブランチをマージできるか、先に競合を解決する必要があるかが通知されます。競合がない場合は、この手順をスキップして次に進みます **変更をレビュー**.

<div align="left"><figure><img src="https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FxUAzNqXiFaXsnaat3KVS%2FUsingSmartMerge-S03-01.png?alt=media&amp;token=e9d7643b-a8d0-4716-ba19-d4e04260d357" alt="" width="563"><figcaption></figcaption></figure></div>

Smart Merge の競合を解決するには、次のことができます **ターゲットの変更を保持** または **ターゲットの変更を上書き** 各変更に対して実行し、望ましい結果を得ます。手順の詳細は次の記事で説明しています。

* [スマートマージの競合の解決](/devops/devops-ja/kdo/buranchi/sumtomjinono.md)
  {% endstep %}

{% step %}

### 変更をレビュー

競合をすべて解決したら、各コンポーネントの変更を次のツールで確認する必要があります **Component Diff Viewer**。変更のあるすべてのコンポーネントは、次の一覧に表示されます **変更のあるコンポーネント** 左側の一覧。コンポーネントをクリックすると Diff Viewer で開き、変更を確認できます。

<div align="left"><figure><img src="https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FTeSlFFXY8eJ8cpfvAC4A%2FUsingSmartMerge-S04-01.png?alt=media&amp;token=67877fcc-1b21-40a7-9590-b634a0635fa2" alt="" width="563"><figcaption></figcaption></figure></div>

1. コンポーネントの変更を確認するには、次の **変更のあるコンポーネント** 左側の一覧からそれを選択します。

{% hint style="warning" %}
すべてのコンポーネントをレビューする必要があります。
{% endhint %}

2. コンポーネントを確認するとき、次のソースコードが **ターゲット** と **ソース** 並べて表示され、差分が強調表示されます。
   1. **赤**: 削除される行。
   2. **緑**: 追加される行。

      <div align="left"><figure><img src="https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FxBpElffmwgvYyVU2RUot%2FUsingSmartMerge-S04-02.png?alt=media&amp;token=2d8dd8b2-dee2-4b02-85a6-b600a3de6928" alt="" width="563"><figcaption></figcaption></figure></div>
3. 各コンポーネントについてレビュー手順を繰り返します。

{% hint style="info" %}
ソース側の変更のうちターゲットにマージしたくないものがある場合は、マージをキャンセルしてソースで変更を行う必要があります。変更を行ったら、もう一度マージを開始できます。
{% endhint %}
{% endstep %}

{% step %}

### 変更をマージ

すべての変更を確認したら、ソースブランチをターゲットブランチにマージできます。

1. 次をクリックします **マージ**.

   <div align="left"><figure><img src="https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FOVImSz0EYSHbB0qz6NFH%2FUsingSmartMerge-S05-01.png?alt=media&amp;token=a0aae933-b8c5-43c1-b4bf-cb77b23beaca" alt="" width="563"><figcaption></figcaption></figure></div>
2. そのジョブが開始されると **マージ** が開始されると、ブランチの **アクティビティ** タブに移動し、そこでジョブのステータスを確認できます。

   <div align="left"><figure><img src="https://225042527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FOsD2oih6XN93ywUL3uAi%2FUsingSmartMerge-S05-02.png?alt=media&amp;token=9923f67e-f387-4e62-8c94-e3f86b5e9fb5" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
その **マージ** ジョブは次の場所に表示されます **アクティビティ** タブに、ターゲットブランチとソースブランチの両方で表示されます。
{% endhint %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/devops/devops-ja/kdo/buranchi/sumtomjino.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
