# 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/collaboration/member-management/roles.md) 可以启用和配置 Git Sync。
{% endhint %}

### skill.md

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


---

# 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.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.
