> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/docs-as-code/git-sync/commits.md).

# 提交信息与自动链接

默认情况下，当将内容从 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="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2FXMOX8gtwZIZGwdSWhSdX%2Fgitsync-autolink%402x.png?alt=media&amp;token=bebbbb78-1a5f-4e90-af21-29803b3d2a7a" alt="A GitBook screenshot showing autolink setup"><figcaption><p>自动链接设置。</p></figcaption></figure></div>

## 自定义提交信息模板

当将 GitBook 与 [monorepo](/docs/documentation/zh/docs-as-code/git-sync/monorepos.md)一起使用时，或者当你对提交信息有特定规范时；你可能希望自定义 GitBook 在向 Git 推送提交时使用的消息。

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

* `{change_request_number}` 变更请求的唯一数字 ID
* `{change_request_subject}` 变更请求合并时的主题，或 `无主题` 如果未提供任何主题。

默认模板为：

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


---

# 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://gitbook.com/docs/documentation/zh/docs-as-code/git-sync/commits.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.
