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

# GitHub-synkronisering

{% 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 återkoppling om du har några problem.
{% endhint %}

{% columns %}
{% column %}

<figure><img src="/files/d7b4f063c57d23ecad42add1455104cc11b7eae4" 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) det 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 `SECRET`.&#x20;

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

Lägg sedan till följande inställningar i dina Overleaf-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 # ändra till din egen

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

# OAuth-återanropet ä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-återrops-URL:en, se till `OVERLEAF_SITE_URL` att den är korrekt inställd.
{% 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 proxy-värd. Om proxyn körs på värdservern, använd serverns LAN-IP (till exempel `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://overleaf-pro.ayaka.space/on-premises/sv/konfiguration/overleaf-toolkit/github-synkronisering.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.
