> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/ja/she-ding/overleaf-toolkit/github-synchronisation.md).

# GitHub 同期

{% hint style="info" %}
この機能は以下によって開発されました [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro)、次によって修正されました [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep)。v6.2.0以降で導入されました。まだベータ版です。何か問題があれば、ぜひフィードバックをお願いします。
{% endhint %}

{% columns %}
{% column %}

<figure><img src="/files/3b16c9471c6598f5eb46fd921a2f5bfcb5f11e41" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2438c5de5e87f424e77189871588b83e4abe3577" alt=""><figcaption></figcaption></figure>
{% endcolumn %}

{% column %}

<figure><img src="/files/6c1efb2925e9b3813d5d1805a9e39d1bd23ba370" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/f6e1fafb231278a4ecb2e65a26c2f817077498ce" alt=""><figcaption></figcaption></figure>
{% endcolumn %}
{% endcolumns %}

### GitHub同期の設定

{% hint style="warning" %}
まず有効にする必要があります [git-bridge](/on-premises/ja/she-ding/overleaf-toolkit/git-integration.md) GitHub同期を使用する前に。

{% code title="config/overleaf.rc" %}

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

アクセスしてください [開発者設定](https://github.com/settings/developers) GitHub OAuthアプリケーションを作成し、以下をコピーしてください `CLIENT_ID` および `SECRET`.

**注意**：OAuthコールバックURLは次のとおりです： `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

次に、以下の設定をOverleafの環境変数ファイルに追加してください。

{% code title="config/variables.env" overflow="wrap" %}

```dotenv
# ユーザーのGitHubアクセストークンを暗号化するために使用します。
# 生成方法: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # あなたのものに変更してください

# GitHub同期設定
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

# OAuthコールバックは次のとおりです: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (任意) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

{% endcode %}

{% hint style="warning" %}
GitHub OAuthコールバックURLを設定する前に、必ず `OVERLEAF_SITE_URL` が正しく設定されていることを確認してください。
{% endhint %}

中国本土にいる場合、GitHubにアクセスするためにプロキシの設定が必要になることがあります。以下の環境変数を設定してください： `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
使用しないでください `127.0.0.1` をプロキシホストとして使用しないでください。プロキシがホストサーバーで動作している場合は、サーバーのLAN IP（たとえば `192.168.1.xx`）のアドレスを使用し、プロキシがローカルネットワーク上のデバイスからの接続を受け入れるように設定されていることを確認してください。
{% endhint %}


---

# 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://ayakaleaf-pro.ayaka.space/on-premises/ja/she-ding/overleaf-toolkit/github-synchronisation.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.
