# コミットメッセージと自動リンク

デフォルトでは、GitBook から Git リポジトリへコンテンツをエクスポートする際、GitBook はマージされた変更リクエストに基づいてコミットメッセージを生成します:

```
GITBOOK-14: ユーザー管理に関するドキュメントを改善
```

## 自動リンク `GITBOOK-<num>` GitHub および GitLab で

GitBook の変更リクエスト ID（例: *GITBOOK-123*）をコミット内でリンクに自動的に解決したい場合は、GitHub の *自動リンク参照* 機能を使って有効にできます。手順は以下を参照してください: [GitHub](https://help.github.com/en/github/administering-a-repository/configuring-autolinks-to-reference-external-resources).

次の URL 形式を使用してください。ここで `spaceId` はあなたのスペースの URL に対応します:

`<https://app.gitbook.com/s/{spaceId}/~/changes/<num>/`

<div data-full-width="false"><figure><img src="/files/5c32c74ce1076e5ef38b97f6417c4a4c01bf0b86" alt="A GitBook screenshot showing autolink setup"><figcaption><p>自動リンクの設定。</p></figcaption></figure></div>

## コミットメッセージのテンプレートをカスタマイズする

GitBook を [モノレポ](/docs/documentation/ja-gitbook-documentation/getting-started/git-sync/monorepos.md)で使用している場合、またはコミットメッセージに特定のガイドラインがある場合は、Git へコミットをプッシュする際に GitBook が使用するメッセージをカスタマイズしたいと思うかもしれません。

テンプレートには次のプレースホルダーを含めることができます:

* `{change_request_number}` 変更リクエストの一意な数値 ID
* `{change_request_subject}` マージ時の変更リクエストの件名、または `件名なし` が指定されていない場合。

デフォルトのテンプレートは次のとおりです:

```
GITBOOK-{change_request_number}: {change_request_subject}
```


---

# Agent Instructions: 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:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/getting-started/git-sync/commits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
