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

# GitHub-synkronisering

{% hint style="info" %}
Denne funktion er udviklet af [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro), ændret af [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Det blev introduceret fra v6.2.0 og senere. Det er stadig i beta-status. Vi har brug for din feedback, hvis du har problemer.
{% endhint %}

{% columns %}
{% column %}

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

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

{% column %}

<figure><img src="/files/73f79315011bf8c602b9a299d6df65ad2e0bed07" alt=""><figcaption></figcaption></figure>

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

### Opsæt GitHub-synkronisering

{% hint style="warning" %}
Du skal aktivere [git-bridge](/on-premises/da/konfiguration/overleaf-toolkit/git-integration.md) før du bruger GitHub-synkronisering.

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

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

Besøg [udviklerindstillinger](https://github.com/settings/developers) for at oprette din GitHub OAuth-applikation og kopiere din `CLIENT_ID` og `SECRET`.&#x20;

**Bemærkninger**: din OAuth-callback-URL er: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Tilføj derefter følgende indstillinger til dine Overleaf-miljøvariabelfiler.

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

```dotenv
# bruges til at kryptere brugerens GitHub-adgangstoken.
# Sådan genereres den: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # ændret til din egen

# GitHub-synkroniseringsindstillinger
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

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

{% endcode %}

{% hint style="warning" %}
Før du konfigurerer GitHub OAuth-callback-URL'en, skal du sørge for `OVERLEAF_SITE_URL` er indstillet korrekt.
{% endhint %}

Hvis du befinder dig i det kinesiske fastland, kan det være nødvendigt at konfigurere en proxy for at få adgang til GitHub. Angiv følgende miljøvariabel: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
Brug ikke `127.0.0.1` som proxy-vært. Hvis proxyen kører på værtsserveren, skal du bruge serverens LAN-IP (f.eks. `192.168.1.xx`) adresse og sørg for, at proxyen er konfigureret til at acceptere forbindelser fra enheder på det lokale netværk.
{% 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/da/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.
