> 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/ar/aliadadat/overleaf-toolkit/git-integration.md).

# تكامل Git

تكامل Git متاح فقط على [ayaka-notes/overleaf](https://github.com/ayaka-notes/overleaf) حاليًا.

{% hint style="info" %}
تم تطوير هذه الميزة في البداية بواسطة [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro).
{% endhint %}

{% stepper %}
{% step %}

### فعّل git-bridge (لمستخدمي Toolkit فقط)

إذا كنت تستخدم Toolkit، فقم بتمكين `git-bridge` عن طريق تعيين ما يلي في `config/overleaf.rc`:

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

```
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endstep %}

{% step %}

### أضف حاوية git-bridge (لمستخدمي Docker Compose فقط)

بالنسبة للمستخدمين الذين يشغّلون `docker-compose.yml`، أضف إعداد الحاوية التالي إلى ملف compose الخاص بك:

{% code title="docker-compose.yml (خدمة git-bridge)" overflow="wrap" %}

```yaml
git-bridge:
    restart: always
    image: quay.io/sharelatex/git-bridge:4.0.0 # يجب أن يطابق الوسم وسم حاوية `sharelatex`
    الأحجام:
        - ~/git_bridge_data:/data/git-bridge
    container_name: git-bridge
    expose:
        - "8000"
    البيئة:
        GIT_BRIDGE_API_BASE_URL: "http://sharelatex:3000/api/v0/" 
        # "http://sharelatex/api/v0/" للإصدار 4.1.6 وما قبله
        GIT_BRIDGE_OAUTH2_SERVER: "http://sharelatex"
        GIT_BRIDGE_POSTBACK_BASE_URL: "http://git-bridge:8000"
        GIT_BRIDGE_ROOT_DIR: "/data/git-bridge"
    user: root
    command: ["/server-pro-start.sh"]
```

{% endcode %}
{% endstep %}

{% step %}

### حدّث إعدادات حاوية sharelatex

ستحتاج أيضًا إلى ربط `git-bridge` الحاوية في `sharelatex` الحاوية وتحديد متغيرات البيئة التالية، يرجى الانتباه إلى `V1_HISTORY_URL`:

<pre class="language-yaml" data-title="docker-compose.yml (خدمة sharelatex)"><code class="lang-yaml">sharelatex:
    links:
        - git-bridge
    البيئة:
         GIT_BRIDGE_ENABLED: true
         GIT_BRIDGE_HOST: "git-bridge"
         GIT_BRIDGE_PORT: "8000"
<strong>         # نستخدم v1 الآن، إذا كنت قد عيّنت V1_HISTORY_URL سابقًا، فيرجى تحديثه الآن
</strong><strong>         V1_HISTORY_URL: "http://sharelatex:3054"
</strong></code></pre>

{% endstep %}

{% step %}

### المصادقة

عند مصادقة عميل Git، يحتاج المستخدمون إلى رمز وصول شخصي. يمكن للمستخدمين إدارة رموز الوصول الشخصية من خلال واجهة التطبيق (راجع التوثيق):

<figure><img src="/files/8951e19f513a4ef3a9f51ff0d4a0dc66688f94d8" alt=""><figcaption><p>رمز الوصول الشخصي لتكامل Git</p></figcaption></figure>
{% endstep %}

{% step %}

### مراقبة الموارد واعتبارات استخدام الموارد

نوصي بمراقبة موارد المضيف لديك بعد تمكين `git-bridge`. ستعتمد زيادة الحمل على:

* عدد المستخدمين الذين يصلون إلى الميزة
* أنواع المشاريع المستضافة في نسختك (عادةً ما تتطلب المشاريع الأكبر موارد أكثر)
  {% endstep %}
  {% endstepper %}

### نقل المشاريع إلى S3

يخزن تكامل Git مستودع git كاملًا على القرص لكل مشروع يتم استنساخه بواسطة مستخدم. إذا كانت مساحة القرص لديك محدودة، فيمكنك تفعيل مهمة تبديل تنقل المستودعات الأقل استخدامًا إلى AWS S3. وإذا احتاج مستودع تم نقله مرة أخرى، فسيُعاد إلى القرص. تتحكم متغيرات البيئة التالية في مهمة التبديل:

| الاسم                                 | الوصف                                                                                                                                                    |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GIT_BRIDGE_SWAPSTORE_TYPE`           | اضبط هذه القيمة على "s3" لتفعيل مهمة التبديل.                                                                                                            |
| `GIT_BRIDGE_SWAPSTORE_AWS_ACCESS_KEY` | مفتاح وصول AWS الخاص بك                                                                                                                                  |
| `GIT_BRIDGE_SWAPSTORE_AWS_SECRET`     | السرّ الخاص بـ AWS                                                                                                                                       |
| `GIT_BRIDGE_SWAPSTORE_S3_BUCKET_NAME` | سيحتوي هذا الدلو على مستودعات git المضغوطة بصيغة zip                                                                                                     |
| `GIT_BRIDGE_SWAPSTORE_AWS_REGION`     | منطقة الدلو                                                                                                                                              |
| `GIT_BRIDGE_SWAPJOB_MIN_PROJECTS`     | <p>الحد الأدنى لعدد المشاريع التي يجب الاحتفاظ بها على القرص.<br><br><strong>- الافتراضي:</strong> 50</p>                                                |
| `GIT_BRIDGE_SWAPJOB_LOW_GIB`          | <p>الحد الأدنى لبدء التبديل. ستنقل مهمة التبديل المشاريع حتى يصبح استخدام القرص أقل من هذه القيمة.<br><br><strong>- الافتراضي:</strong> 128 غيغابايت</p> |
| `GIT_BRIDGE_SWAPJOB_HIGH_GIB`         | <p>الحد الأعلى لبدء التبديل. ستبدأ مهمة التبديل عند وصول استخدام القرص إلى هذه القيمة.<br><br><strong>- الافتراضي:</strong> 256 غيغابايت</p>             |
| `GIT_BRIDGE_SWAPJOB_INTERVAL_MILLIS`  | <p>المدة الزمنية بين التحقق من استخدام القرص وتشغيل مهمة التبديل.<br><br><strong>- الافتراضي:</strong> 3600000 مللي ثانية = ساعة واحدة</p>               |

### الأسئلة والأجوبة

<details>

<summary>إذا شاركت مشروعي مع شخص آخر، كيف يعمل نموذج أذونات Git Bridge؟</summary>

يمكن للمستخدمين ذوي الوصول للقراءة فقط استنساخ هذا المشروع فقط؛ ويمكن للمستخدمين ذوي الوصول للقراءة والكتابة استنساخ المشاريع ودفعها. ملاحظة: يجب أن يكون المستخدمون مسجّلين الدخول للانضمام إلى هذا المشروع.

</details>


---

# 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/ar/aliadadat/overleaf-toolkit/git-integration.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.
