> 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/on-premises-cs/konfigurace/overleaf-toolkit/synchronizace-s-githubem.md).

# Synchronizace s GitHubem

{% hint style="info" %}
Tato funkce je vyvinuta [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro), upraveno společností [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Je představena od verze v6.2.0 a novější. Stále je ve stavu beta. Pokud narazíte na jakýkoli problém, potřebujeme vaši zpětnou vazbu.
{% endhint %}

{% columns %}
{% column %}

<figure><img src="/files/471d67dc3f89d4fa5b66f4316be05d9a122575f1" alt=""><figcaption></figcaption></figure>

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

{% column %}

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

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

### Nastavení synchronizace GitHubu

{% hint style="warning" %}
Musíte povolit [git-bridge](/on-premises/on-premises-cs/konfigurace/overleaf-toolkit/git-integration.md) dříve, než začnete používat synchronizaci GitHubu.

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

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

Navštivte [nastavení pro vývojáře](https://github.com/settings/developers) k vytvoření vaší GitHub OAuth aplikace a zkopírujte své `CLIENT_ID` a `SECRET`.&#x20;

**Poznámky**: vaše URL pro OAuth callback je: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Poté přidejte následující nastavení do vašich souborů proměnných prostředí Overleafu.

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

```dotenv
# používá se k šifrování přístupového tokenu GitHubu uživatele.
# Jak vygenerovat: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # změňte na své

# Nastavení synchronizace GitHubu
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

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

{% endcode %}

{% hint style="warning" %}
Před konfigurací URL pro GitHub OAuth callback se ujistěte, `OVERLEAF_SITE_URL` že je nastaveno správně.
{% endhint %}

Pokud se nacházíte v pevninské Číně, možná budete muset pro přístup ke GitHubu nakonfigurovat proxy. Nastavte následující proměnnou prostředí: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Nepoužívejte `127.0.0.1` pro hostitele proxy. Pokud proxy běží na hostitelském serveru, použijte LAN IP serveru (například `192.168.1.xx`) adresu a ujistěte se, že je proxy nakonfigurována tak, aby přijímala připojení ze zařízení v lokální síti.
{% 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/on-premises-cs/konfigurace/overleaf-toolkit/synchronizace-s-githubem.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.
