> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Git 集成

> 将 Devin 连接到您的源代码仓库

<div id="enterprise-source-code-management-setup">
  ## Enterprise 源代码管理设置
</div>

要让 Devin 访问你的代码仓库，你必须先将你的源代码管理 (SCM) 提供商连接到 Enterprise，然后再授予某个 Devin 组织访问特定群组或代码仓库的权限。

<Note>
  SCM 集成只能由 Enterprise 管理员进行配置。
</Note>

在 **Enterprise Settings > Integrations** 中开始操作，将 Devin 连接到你的源代码。

<Frame caption="Enterprise Integrations">
  <img src="https://mintcdn.com/cognitionai/IRy9C2mAI1Fl2Qc9/images/enterprise/Enterprise-Integrations.png?fit=max&auto=format&n=IRy9C2mAI1Fl2Qc9&q=85&s=df9775c0a93ac2b97a43373b528055c4" alt="Enterprise Integrations" width="3598" height="2074" data-path="images/enterprise/Enterprise-Integrations.png" />
</Frame>

有关配置 Git 集成的更多信息，请参阅你的 SCM 提供商的相关文档：

<CardGroup cols={2}>
  <Card title="GitHub" icon="github" href="/zh/integrations/gh">
    将 Devin 连接到 GitHub 代码仓库。
  </Card>

  <Card title="GitHub Enterprise Server" icon="github" href="/zh/enterprise/integrations/github-enterprise-server">
    将 Devin 连接到你的 GitHub Enterprise Server。
  </Card>

  <Card title="Azure DevOps" icon="microsoft" href="/zh/enterprise/integrations/azure-devops">
    将 Devin 连接到 Azure DevOps 代码仓库。
  </Card>

  <Card title="GitLab" icon="gitlab" href="/zh/integrations/gitlab">
    将 Devin 连接到 GitLab 代码仓库。
  </Card>

  <Card title="Bitbucket" icon="bitbucket" href="/zh/integrations/bitbucket">
    将 Devin 连接到 Bitbucket 代码仓库。
  </Card>
</CardGroup>

<div id="repository-permissions">
  ## 仓库权限
</div>

将你的 Devin Enterprise 连接到 SCM 提供商会建立一条安全连接，使你能够管理不同组织和代码仓库的访问权限。不过，在你明确授予权限之前，Devin 组织无法访问或操作你的仓库。

在将 Devin Enterprise 连接到 SCM 提供商之后，你可以在 **Enterprise 设置 > 仓库权限** 中管理仓库权限。

<div id="adding-or-updating-permissions">
  ### 添加或更新权限
</div>

1. 从页面顶部的下拉菜单中选择你要为其管理代码库访问权限的 Devin 组织。
   * 在这里可以查看当前已配置的所有权限和代码库。
2. 点击 **+ Add Permissions** 打开权限侧边栏。
3. 选择你希望授予的访问级别：
   * **组级访问**：授予对某个组织单元内所有代码库的访问权限。选择你的 SCM 提供商的分组结构：
     * GitHub / GitHub Enterprise Server: Organization
     * Azure DevOps: Organization 或 Project
     * GitLab: Group 或 Subgroup
     * Bitbucket: Workspace
   * **代码库级访问**：授予对单个特定代码库的访问权限。
4. 如有需要，使用下拉菜单按 Git 提供商进行筛选。
5. 选择 **Add permissions** 以保存更改。

<Frame caption="Add Repositories">
  <img src="https://mintcdn.com/cognitionai/IRy9C2mAI1Fl2Qc9/images/enterprise/Enterprise-Add-Repositories.png?fit=max&auto=format&n=IRy9C2mAI1Fl2Qc9&q=85&s=5d056bf93a6f544b0f5893692f365b2b" alt="Add Repositories" width="2360" height="1322" data-path="images/enterprise/Enterprise-Add-Repositories.png" />
</Frame>

<div id="revoking-permissions">
  ### 撤销权限
</div>

要撤销对代码库或分组的访问权限：

* 点击要移除的权限右侧的 **垃圾桶图标**，或
* 进入 **+ Add Permissions**，取消勾选该权限并保存。

保存后，该 Devin Organization 将不再能够访问这些代码库或分组。
