> 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/it/configurazione/overleaf-toolkit/sincronizzazione-github.md).

# Sincronizzazione GitHub

{% hint style="info" %}
Questa funzionalità è sviluppata da [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro), modificata da [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). È stato introdotto dalla v6.2.0 e successive. È ancora in beta. Abbiamo bisogno del tuo feedback se riscontri qualsiasi problema.
{% endhint %}

{% columns %}
{% column %}

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

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

{% column %}

<figure><img src="/files/6380d60ed76dc4759e73e84f6bec994c7e8c2d40" alt=""><figcaption></figcaption></figure>

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

### Configura la sincronizzazione con GitHub

{% hint style="warning" %}
Devi abilitare [git-bridge](/on-premises/it/configurazione/overleaf-toolkit/git-integration.md) prima di usare la sincronizzazione con GitHub.

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

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

Visita [le impostazioni sviluppatori](https://github.com/settings/developers) per creare la tua applicazione OAuth di GitHub e copia il tuo `CLIENT_ID` e `SECRET`.&#x20;

**Note**: il tuo URL di callback OAuth è: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Quindi, aggiungi le seguenti impostazioni ai file delle variabili d'ambiente di Overleaf.

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

```dotenv
# usato per crittografare il token di accesso GitHub dell'utente.
# Come generare: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # sostituiscilo con il tuo

# Impostazioni di sincronizzazione GitHub
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

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

{% endcode %}

{% hint style="warning" %}
Prima di configurare l'URL di callback OAuth di GitHub, assicurati `OVERLEAF_SITE_URL` che sia impostato correttamente.
{% endhint %}

Se ti trovi nella Cina continentale, potresti dover configurare un proxy per accedere a GitHub. Imposta la seguente variabile d'ambiente: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Non usare `127.0.0.1` come host del proxy. Se il proxy è in esecuzione sul server host, usa l'IP LAN del server (come `192.168.1.xx`) come indirizzo e assicurati che il proxy sia configurato per accettare connessioni da dispositivi sulla rete locale.
{% 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/it/configurazione/overleaf-toolkit/sincronizzazione-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.
