# 提交消息与自动链接

默认情况下，当将内容从 GitBook 导出到 Git 仓库时，GitBook 会根据已合并的变更请求生成提交消息：

```
GITBOOK-14：改进有关用户管理的文档
```

## 自动链接 `GITBOOK-<num>` 在 GitHub 和 GitLab 中

如果你想在提交中自动将 GitBook 变更请求 ID（例如 *GITBOOK-123*）解析为链接，你可以使用 GitHub 的 *自动链接引用* 功能来启用此项。请参阅 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/3e2697b5a27e8c7490d2dc5cf47506753258f4a1" alt="A GitBook screenshot showing autolink setup"><figcaption><p>自动链接设置。</p></figcaption></figure></div>

## 自定义提交消息模板

当将 GitBook 与 [单体仓库](/docs/documentation/zh/getting-started/git-sync/monorepos.md)一起使用时，或者当你对提交消息有特定指南时；你可能希望自定义 GitBook 在向 Git 推送提交时使用的消息。

模板可以包含以下占位符：

* `{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/zh/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.
