> 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/wen-dang-ji-dai-ma/git-sync.md).

# GitHub 与 GitLab 同步

<figure><img src="/files/9bfd92947af286c30c162766617e17d010f918b6" alt="A GitBook screenshot showing the Git Sync setup"><figcaption><p>为你的 GitBook 章节设置 Git Sync。</p></figcaption></figure>

### 概览

Git Sync 让技术团队能够将 GitHub 或 GitLab 仓库与 GitBook 同步，并把 Markdown 文件转换为美观、易用的文档。你可以直接在 GitBook 强大的编辑器中编辑，同时保持内容与 GitHub 或 GitLab 上的代码库同步。

Git Sync 是双向同步的，因此你在 GitBook 编辑器中直接所做的更改会自动同步，GitHub 或 GitLab 上提交的任何内容也一样。这使开发者可以直接从 GitHub 或 GitLab 提交，而技术文档撰写者、教学设计师和产品经理可以直接在 GitBook 中编辑、讨论并反馈更改。

{% hint style="info" %}
Git Sync 为企业客户支持 IP 白名单。如果你的 GitHub、GitLab 或内部网络只接受来自已批准 IP 的流量，请在启用该集成之前，将以下出站 Git Sync IP 加入白名单：

* `34.136.22.210`
* `34.29.189.57`
* `35.223.181.150`
* `34.72.115.112`
* `136.116.236.109`
  {% endhint %}

{% hint style="info" %}
仅 [管理员和创建者](/docs/documentation/zh/xie-zuo/member-management/roles.md) 可以启用和配置 Git Sync。
{% endhint %}

### skill.md

当你使用 Git Sync 在本地处理文档时，你可以使用 GitBook 的 [skill.md 文件](/docs/documentation/zh/wen-dang-ji-dai-ma/ai-coding-assistants-and-skillmd.md) 为 AI 编码助手提供有关 GitBook 的区块、功能和最佳实践的上下文。


---

# 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://gitbook.com/docs/documentation/zh/wen-dang-ji-dai-ma/git-sync.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.
