> 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/ko/configuration/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를 활성화하세요(툴킷 사용자만)

툴킷을 사용 중이라면, 다음을 활성화하세요 `git-bridge` 다음 값을 설정하여 `config/overleaf.rc`:

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

```
GIT_BRIDGE_ENABLED=true
```

{% endcode %}
{% endstep %}

{% step %}

### git-bridge 컨테이너를 추가하세요(도커 컴포즈 사용자만)

사용자 지정 `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/" 
        # 4.1.6 및 그 이전 버전에서는 "http://sharelatex/api/v0/"
        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 클라이언트를 인증할 때 사용자는 Personal Access Token이 필요합니다. 사용자는 애플리케이션 UI에서 Personal Access Token을 관리할 수 있습니다(문서 참조):

<figure><img src="/files/7e56cc12b755658147279036d255721d7ec6683a" alt=""><figcaption><p>Git 통합 Personal Access Token</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 GB</p> |
| `GIT_BRIDGE_SWAPJOB_HIGH_GIB`         | <p>스와핑을 위한 상한값입니다. 디스크 사용량이 이 값에 도달하면 스와프 작업이 시작됩니다.<br><br><strong>- 기본값:</strong> 256 GB</p>           |
| `GIT_BRIDGE_SWAPJOB_INTERVAL_MILLIS`  | <p>디스크 사용량을 확인하고 스와프 작업을 실행하는 사이의 시간입니다.<br><br><strong>- 기본값:</strong> 3600000 ms = 1시간</p>             |

### Q\&A

<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/ko/configuration/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.
