> 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/configuration/overleaf-toolkit/github-synchronisation.md).

# GitHub Synchronisation

{% hint style="info" %}
This feature is developed by [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro), modified by [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). It is introduced from v6.2.0 and later. It's still in beta status. We need your feedback if you have any problem.
{% endhint %}

{% columns %}
{% column %}

<figure><img src="/files/lh62ubAwzuxLynXt99Tl" alt=""><figcaption></figcaption></figure>

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

{% column %}

<figure><img src="/files/wSq87Zg1z86cNLQuIgTg" alt=""><figcaption></figcaption></figure>

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

### Setup GitHub Synchronisation

{% hint style="warning" %}
You need to enable [git-bridge](/on-premises/configuration/overleaf-toolkit/git-integration.md) first before using GitHub Synchronisation.

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

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

Visit [developers settings](https://github.com/settings/developers) to create your GitHub OAuth application, and copy your `CLIENT_ID` and `SECRET`.

**Notes**: your OAuth callback URL is: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Then, add the following settings to your overleaf env var files.

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

```dotenv
# used to encrypt the user's GitHub access token.
# How to generate: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # changed to yours

# Github Sync Settings
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

# OAuth callback is: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (Optional) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

{% endcode %}

{% hint style="warning" %}
Before configuring the GitHub OAuth callback URL, make sure `OVERLEAF_SITE_URL` is set correctly.
{% endhint %}

If you are located in mainland China, you may need to configure a proxy to access GitHub. Set the following environment variable: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Do not use `127.0.0.1` for proxy host. If the proxy is running on host server, use the server’s LAN IP (like `192.168.1.xx`) address and make sure the proxy is configured to accept connections from devices on the local network.
{% 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/configuration/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.
