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

# Synkronisering med GitHub

{% hint style="info" %}
Denna funktion är utvecklad av [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro), modifierad av [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Den introduceras från v6.2.0 och senare. Den är fortfarande i betastatus. Vi behöver din feedback om du stöter på några problem.
{% endhint %}

{% columns %}
{% column %}

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

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

{% column %}

<figure><img src="/files/22e12635877adbeb64a505077b67a33e72d46978" alt=""><figcaption></figcaption></figure>

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

### Konfigurera GitHub-synkronisering

{% hint style="warning" %}
Du behöver aktivera [git-bridge](/on-premises/sv/konfiguration/overleaf-toolkit/git-integration.md) först innan du använder GitHub-synkronisering.

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

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

Besök [utvecklarinställningarna](https://github.com/settings/developers) för att skapa din GitHub OAuth-applikation och kopiera din `CLIENT_ID` och `KLIENTHEMLIGHET`.

**Anteckningar**: din OAuth-callback-URL är: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Lägg sedan till följande inställningar i dina överleaf-miljövariabelfiler.

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

```dotenv
# används för att kryptera användarens GitHub-åtkomsttoken.
# Så här genererar du: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # byt ut mot din egen

# Inställningar för GitHub-synkronisering
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

# OAuth-callbacken är: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (valfritt) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

{% endcode %}

{% hint style="warning" %}
Innan du konfigurerar GitHub OAuth-callback-URL:en, se till att `OVERLEAF_SITE_URL` är korrekt inställt.
{% endhint %}

Om du befinner dig i fastlandskina kan du behöva konfigurera en proxy för att komma åt GitHub. Ange följande miljövariabel: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Använd inte `127.0.0.1` som proxyvärd. Om proxyn körs på värdservern, använd serverns LAN-IP (t.ex. `192.168.1.xx`) adress och se till att proxyn är konfigurerad för att acceptera anslutningar från enheter i det lokala nätverket.
{% 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/sv/konfiguration/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.
