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

# مزامنة GitHub

{% hint style="info" %}
تم تطوير هذه الميزة بواسطة [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro)، وتم تعديلها بواسطة [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). تم تقديمه ابتداءً من v6.2.0 وما بعدها. ولا يزال في حالة بيتا. نحتاج إلى ملاحظاتك إذا واجهت أي مشكلة.
{% endhint %}

{% columns %}
{% column %}

<figure><img src="/files/5477a5f9b2948d3c8dddce75e7089cbc139a69a1" alt=""><figcaption></figcaption></figure>

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

{% column %}

<figure><img src="/files/4dedc7df06da5fe348a7c106c916c22fafe77cdb" alt=""><figcaption></figcaption></figure>

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

### إعداد مزامنة GitHub

{% hint style="warning" %}
تحتاج إلى تفعيل [git-bridge](/on-premises/ar/althyeh/overleaf-toolkit/git-integration.md) أولًا قبل استخدام مزامنة GitHub.

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

```dotenv
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endhint %}

زر [إعدادات المطوّر](https://github.com/settings/developers) لإنشاء تطبيق OAuth الخاص بك على GitHub، ثم انسخ `CLIENT_ID` و `SECRET`.

**ملاحظات**‏: عنوان URL لردّ OAuth الخاص بك هو: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

ثم أضِف الإعدادات التالية إلى ملفات متغيرات البيئة الخاصة بـ Overleaf.

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

```dotenv
# يُستخدم لتشفير رمز الوصول إلى GitHub الخاص بالمستخدم.
# كيفية التوليد: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # غيّره إلى قيمتك الخاصة

# إعدادات مزامنة GitHub
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

# عنوان رد الاتصال لـ OAuth هو: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (اختياري) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

{% endcode %}

{% hint style="warning" %}
قبل إعداد عنوان URL لرد الاتصال الخاص بـ GitHub OAuth، تأكد من `OVERLEAF_SITE_URL` أنه مضبوط بشكل صحيح.
{% endhint %}

إذا كنت موجودًا في برّ الصين الرئيسي، فقد تحتاج إلى إعداد وكيل للوصول إلى GitHub. عيّن متغير البيئة التالي: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

{% hint style="warning" %}
لا تستخدم `127.0.0.1` كمضيف للوكيل. إذا كان الوكيل يعمل على خادم المضيف، فاستخدم عنوان IP المحلي للشبكة الخاصة بالخادم (مثل `192.168.1.xx`) وعنوان، وتأكد من أن الوكيل مُعدّ لقبول الاتصالات من الأجهزة الموجودة على الشبكة المحلية.
{% 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/ar/althyeh/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.
