> 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/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`
    volumes:
        - ~/git_bridge_data:/data/git-bridge
    container_name: git-bridge
    expose:
        - "8000"
    environment:
        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
    environment:
         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 المضغوطة                                                                                                            |
| `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://ayakaleaf-pro.ayaka.space/on-premises/ar/althyeh/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.
