> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Đồng bộ hóa GitHub

<Info>
  Tính năng này được phát triển bởi [ayaka-notes/overleaf-pro](https://github.com/ayaka-notes/overleaf-pro) và được chỉnh sửa bởi [yu-i-i/overleaf-cep](https://github.com/yu-i-i/overleaf-cep). Tính năng được giới thiệu từ v6.2.0 trở đi và vẫn đang ở trạng thái beta. Nếu gặp bất kỳ vấn đề nào, chúng tôi rất mong nhận được phản hồi của bạn.
</Info>

<Columns cols={2}>
  <Column>
    <Frame>
      <img src="https://mintcdn.com/ayakaleaf-pro/x9kfDjtWlyyhG_mR/images/on-premises/image-35.png?fit=max&auto=format&n=x9kfDjtWlyyhG_mR&q=85&s=e901d54b071a78ae8de0efbb66fb000a" alt="" width="2738" height="1568" data-path="images/on-premises/image-35.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/ayakaleaf-pro/x9kfDjtWlyyhG_mR/images/on-premises/image-38.png?fit=max&auto=format&n=x9kfDjtWlyyhG_mR&q=85&s=90e4cb5dcaa49bd81983dcb8c770056c" alt="" width="2988" height="1980" data-path="images/on-premises/image-38.png" />
    </Frame>
  </Column>

  <Column>
    <Frame>
      <img src="https://mintcdn.com/ayakaleaf-pro/x9kfDjtWlyyhG_mR/images/on-premises/image-34.png?fit=max&auto=format&n=x9kfDjtWlyyhG_mR&q=85&s=aa73e00b277a4d01a5339c8a6f91a189" alt="" width="2738" height="1568" data-path="images/on-premises/image-34.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/ayakaleaf-pro/x9kfDjtWlyyhG_mR/images/on-premises/image-39.png?fit=max&auto=format&n=x9kfDjtWlyyhG_mR&q=85&s=26d47eb61da2e7acfab8f5951e3cd67e" alt="" width="2988" height="1980" data-path="images/on-premises/image-39.png" />
    </Frame>
  </Column>
</Columns>

### Thiết lập đồng bộ hóa GitHub

<Warning>
  Bạn cần bật [git-bridge](/vi/on-premises/configuration/overleaf-toolkit/git-integration) trước khi sử dụng đồng bộ hóa GitHub.

  ```dotenv title="config/overleaf.rc" theme={null}
  GIT_BRIDGE_ENABLED=true
  ```
</Warning>

Truy cập [developers settings](https://github.com/settings/developers) để tạo ứng dụng GitHub OAuth của bạn, sau đó sao chép `CLIENT_ID` và `SECRET`.

**Lưu ý**: URL callback OAuth của bạn là: `${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback`.

Sau đó, thêm các cài đặt sau vào tệp biến môi trường của Overleaf.

```dotenv title="config/variables.env" wrap theme={null}
# used to encrypt the user's GitHub access token.
# How to generate: `openssl rand -hex 32`
GITHUB_TOKEN_CIPHER_PASSWORD=0123456789ABCDEFG # changed to yours

# Github Sync Settings
GITHUB_SYNC_ENABLED=true
GITHUB_SYNC_CLIENT_ID=
GITHUB_SYNC_CLIENT_SECRET=

# OAuth callback is: ${OVERLEAF_SITE_URL}/user/github-sync/oauth2/callback
# (Optional) GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808
```

<Warning>
  Trước khi cấu hình URL callback OAuth của GitHub, hãy đảm bảo `OVERLEAF_SITE_URL` đã được đặt chính xác.
</Warning>

Nếu bạn ở Trung Quốc đại lục, có thể bạn cần cấu hình proxy để truy cập GitHub. Hãy đặt biến môi trường sau: `GITHUB_SYNC_PROXY_URL=http://10.0.0.1:10808`.

<Warning>
  Không sử dụng `127.0.0.1` làm máy chủ proxy. Nếu proxy chạy trên máy chủ host, hãy dùng địa chỉ IP LAN của máy chủ (ví dụ `192.168.1.xx`) và đảm bảo proxy được cấu hình để chấp nhận kết nối từ các thiết bị trong mạng cục bộ.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.