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

# Integrasi Git

Integrasi Git hanya tersedia di [ayaka-notes/overleaf](https://github.com/ayaka-notes/overleaf) saat ini.

{% hint style="info" %}
Fitur ini awalnya dikembangkan oleh [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro).
{% endhint %}

{% stepper %}
{% step %}

### Aktifkan git-bridge (Hanya untuk pengguna Toolkit)

Jika Anda menggunakan Toolkit, aktifkan `git-bridge` dengan menetapkan hal berikut di `config/overleaf.rc`:

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

```
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endstep %}

{% step %}

### Tambahkan container git-bridge (Hanya untuk pengguna Docker Compose)

Bagi pengguna yang menjalankan `docker-compose.yml`, tambahkan konfigurasi container berikut ke file compose Anda:

{% code title="docker-compose.yml (layanan git-bridge)" overflow="wrap" %}

```yaml
git-bridge:
    restart: selalu
    image: quay.io/sharelatex/git-bridge:4.0.0 # tag harus cocok dengan tag container `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/" untuk versi 4.1.6 dan sebelumnya
        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 %}

### Perbarui konfigurasi container sharelatex

Anda juga perlu menautkan `git-bridge` container di `sharelatex` container dan mendefinisikan variabel lingkungan berikut, harap perhatikan `V1_HISTORY_URL`:

<pre class="language-yaml" data-title="docker-compose.yml (layanan sharelatex)"><code class="lang-yaml">sharelatex:
    links:
        - git-bridge
    environment:
         GIT_BRIDGE_ENABLED: true
         GIT_BRIDGE_HOST: "git-bridge"
         GIT_BRIDGE_PORT: "8000"
<strong>         # Kami sekarang menggunakan v1, jika sebelumnya Anda menetapkan V1_HISTORY_URL, harap perbarui sekarang
</strong><strong>         V1_HISTORY_URL: "http://sharelatex:3054"
</strong></code></pre>

{% endstep %}

{% step %}

### Autentikasi

Saat mengautentikasi klien git, pengguna memerlukan Personal Access Token. Pengguna dapat mengelola Personal Access Token melalui UI aplikasi (lihat dokumentasi):

<figure><img src="/files/1d804576d290ff01cf2598168444e2afa8b028dc" alt=""><figcaption><p>Token Akses Pribadi Integrasi Git</p></figcaption></figure>
{% endstep %}

{% step %}

### Pemantauan dan pertimbangan sumber daya

Kami merekomendasikan Anda memantau sumber daya host setelah mengaktifkan `git-bridge`. Peningkatan beban akan bergantung pada:

* jumlah pengguna yang mengakses fitur ini
* jenis proyek yang di-host di instance Anda (proyek yang lebih besar umumnya lebih banyak membutuhkan sumber daya)
  {% endstep %}
  {% endstepper %}

### Memindahkan proyek ke S3

Integrasi Git menyimpan repositori git lengkap di disk untuk setiap proyek yang diklon oleh pengguna. Jika ruang disk Anda terbatas, Anda dapat mengaktifkan tugas swap yang akan memindahkan repositori yang lebih jarang digunakan ke AWS S3. Jika repositori yang dipindahkan diperlukan lagi, repositori tersebut akan dipindahkan kembali ke disk. Variabel lingkungan berikut mengontrol tugas swap:

| Nama                                  | Deskripsi                                                                                                                                                            |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GIT_BRIDGE_SWAPSTORE_TYPE`           | Setel ini ke "s3" untuk mengaktifkan tugas swap.                                                                                                                     |
| `GIT_BRIDGE_SWAPSTORE_AWS_ACCESS_KEY` | Kunci akses AWS Anda                                                                                                                                                 |
| `GIT_BRIDGE_SWAPSTORE_AWS_SECRET`     | Rahasia AWS Anda                                                                                                                                                     |
| `GIT_BRIDGE_SWAPSTORE_S3_BUCKET_NAME` | Bucket ini akan berisi repositori git yang telah dizip                                                                                                               |
| `GIT_BRIDGE_SWAPSTORE_AWS_REGION`     | Wilayah bucket                                                                                                                                                       |
| `GIT_BRIDGE_SWAPJOB_MIN_PROJECTS`     | <p>Jumlah minimum proyek yang disimpan di disk.<br><br><strong>- Bawaan:</strong> 50</p>                                                                             |
| `GIT_BRIDGE_SWAPJOB_LOW_GIB`          | <p>Ambang batas rendah untuk swap. Tugas swap akan memindahkan proyek hingga penggunaan disk berada di bawah nilai ini.<br><br><strong>- Bawaan:</strong> 128 GB</p> |
| `GIT_BRIDGE_SWAPJOB_HIGH_GIB`         | <p>Ambang batas tinggi untuk swap. Tugas swap akan mulai melakukan swap saat penggunaan disk mencapai nilai ini.<br><br><strong>- Bawaan:</strong> 256 GB</p>        |
| `GIT_BRIDGE_SWAPJOB_INTERVAL_MILLIS`  | <p>Jeda waktu antara pemeriksaan penggunaan disk dan menjalankan tugas swap.<br><br><strong>- Bawaan:</strong> 3600000 ms = 1 jam</p>                                |

### Tanya Jawab

<details>

<summary>Jika saya membagikan proyek saya dengan orang lain, bagaimana cara kerja model izin Git Bridge?</summary>

Pengguna dengan akses hanya-baca hanya dapat mengklon proyek ini; pengguna dengan akses baca-tulis dapat mengklon dan mendorong proyek. Catatan: Pengguna harus sudah masuk untuk bergabung ke proyek ini.

</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/id/konfigurasi/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.
