> 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/ja-gitbook-documentation/docs-as-code/git-sync.md).

# GitHub & GitLab 同期

<figure><img src="/files/a45190fa3c4461a7d07db5ae4b5ccee23235598e" alt="A GitBook screenshot showing the Git Sync setup"><figcaption><p>GitBook のドキュメントに Git Sync を設定します。</p></figcaption></figure>

### 概要

Git Sync を使うと、技術チームは GitHub または GitLab のリポジトリを GitBook と同期し、Markdown ファイルのリポジトリを見やすく使いやすいドキュメントに変換できます。GitHub または GitLab のコードベースとコンテンツを同期したまま、GitBook の強力なエディタで直接編集できます。

Git Sync は双方向なので、GitBook のエディタで直接行った変更は自動的に同期され、GitHub または GitLab で行われたコミットも同様に同期されます。これにより、開発者は GitHub または GitLab から直接コミットでき、テクニカルライター、インストラクショナルデザイナー、プロダクトマネージャーは GitBook 内で直接変更の編集、議論、フィードバックができます。

### Git Sync を設定する

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-github">:github:</i></h4></td><td><h4>GitHub Sync を設定する</h4></td><td>GitBook 用に GitHub 連携を設定して認証します。</td><td><a href="/spaces/hMBa7q4krJX0GpAhDwLc/pages/9f5c91631cf2369237bfc9cadc5d6ef254c671ec">/spaces/hMBa7q4krJX0GpAhDwLc/pages/9f5c91631cf2369237bfc9cadc5d6ef254c671ec</a></td></tr><tr><td><h4><i class="fa-gitlab">:gitlab:</i></h4></td><td><h4>GitLab Sync を設定する</h4></td><td>GitBook 用に GitLab 連携を設定して認証します。</td><td><a href="/spaces/hMBa7q4krJX0GpAhDwLc/pages/2412e61c03b4eef526a7b8f80a198593d8a933d1">/spaces/hMBa7q4krJX0GpAhDwLc/pages/2412e61c03b4eef526a7b8f80a198593d8a933d1</a></td></tr></tbody></table>

{% hint style="info" %}
Git Sync は Enterprise のお客様向けに 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/ja-gitbook-documentation/koraborshon/member-management/roles.md) が Git Sync を有効化および設定できます。
{% endhint %}

### AI エージェントとの作業

Git Sync を使ってローカルでドキュメント作成を行う際、GitBook の [skill.md ファイル](/docs/documentation/ja-gitbook-documentation/docs-as-code/ai-coding-assistants-and-skillmd.md) を使って、AI コーディングアシスタントに GitBook のブロック、機能、ベストプラクティスに関する文脈を提供できます。

詳細は [Agent skills](/docs/documentation/ja-gitbook-documentation/docs-as-code/ai-coding-assistants-and-skillmd.md) をご覧ください。


---

# 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/ja-gitbook-documentation/docs-as-code/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.
