> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/autofix-to/automation-and-merging/auto-merge-autofix-pull-requests.md).

# AutoFixプルリクエストを自動マージする

## 自動マージはいつ使うべきですか？

自動マージ機能は、定義された条件がすべて満たされた時点で Pull Request を自動的にマージすることで、開発ワークフローを効率化します。

これにより、プルリクエストの追跡やマージを手動で行う必要がなくなり、ワークフローの速度を大幅に向上できます。開発者は各 PR の条件を常に確認したり、定期的にマージを開始したりする必要がなくなります。

Aikido は、GitHub、GitLab、Azure DevOps に標準搭載されている自動マージ機能を利用します。Autofix の設定では、Aikido が作成した PR に対して自動マージを有効にできます。

## GitHub

リポジトリでプルリクエストの自動マージを有効にする： [リポジトリでのプルリクエストの自動マージを管理する - GitHub Docs](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository?utm_source=chatgpt.com).[\ <br>](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository?utm_source=chatgpt.com)対象ブランチにブランチ保護ルールを設定することを強くおすすめします： [ブランチ保護ルールを管理する - GitHub Docs](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/managing-a-branch-protection-rule)。これにより、自動マージがトリガーされる前に満たす必要のある条件を定義できます。

## GitLab（Cloud & Server）

GitLab リポジトリで自動マージを有効にする方法はこちらをご覧ください： [自動マージ | GitLab Docs](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)

Aikido が自動マージを有効にした PR を作成するには、GitLab でブランチポリシーを設定する必要があります： [保護されたブランチ | GitLab Docs](https://docs.gitlab.com/user/project/repository/branches/protected/)

最後に、Aikido が自動マージを有効にした PR を作成するには、パイプラインを PR にリンクする必要があります： [CI/CD パイプライン | GitLab Docs](https://docs.gitlab.com/ci/pipelines/)

パイプラインが成功し、マージチェックが完了すると、PR は自動的にマージされます。

## Azure DevOps

PR をいつ自動完了するかを定義するために、対象ブランチでブランチポリシーを有効にすることを強くおすすめします： [Git ブランチ ポリシーと設定 - Azure Repos | Microsoft Learn](https://learn.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops\&tabs=browser)

## Bitbucket

Bitbucket には、上記のような自動マージ機能はありません。Bitbucket が提供する自動マージ機能を使用する場合でも、ユーザーは引き続き手動でマージボタンをクリックする必要があります。 [プルリクエストをマージする | Bitbucket Data Center 10.0 | Atlassian Documentation](https://confluence.atlassian.com/bitbucketserver/merge-a-pull-request-808488562.html)

<br>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/autofix-to/automation-and-merging/auto-merge-autofix-pull-requests.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
