> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/on-premises/uk/konfiguraciya/overleaf-toolkit/sinkhronizaciya-github.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/dbfb7773b9d8d46bf8e210ad9788b894f7aa7893" alt=""><figcaption></figcaption></figure>

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

{% column %}

<figure><img src="/files/9e799e6c4ad7755e06c60721cbfe5b7879dfc5ed" alt=""><figcaption></figcaption></figure>

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

### Налаштування синхронізації GitHub

{% hint style="warning" %}
Вам потрібно увімкнути [git-bridge](/on-premises/uk/konfiguraciya/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`.&#x20;

**Примітки**: ваша URL-адреса зворотного виклику OAuth: `${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=

# URL зворотного виклику OAuth: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (необов’язково) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

{% endcode %}

{% hint style="warning" %}
Перш ніж налаштовувати URL зворотного виклику GitHub OAuth, переконайтеся `OVERLEAF_SITE_URL` що він налаштований правильно.
{% endhint %}

Якщо ви перебуваєте в материковому Китаї, вам може знадобитися налаштувати проксі для доступу до GitHub. Встановіть таку змінну середовища: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Не використовуйте `127.0.0.1` як хост проксі. Якщо проксі запущено на сервері-хості, використовуйте LAN-адресу сервера (наприклад, `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://overleaf-pro.ayaka.space/on-premises/uk/konfiguraciya/overleaf-toolkit/sinkhronizaciya-github.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.
