我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2020-01-22. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持

Managing repositories

You can manage the repositories connected to GitHub Insights and the data included in metrics for each repository.

People with admin permissions in GitHub Insights can manage repositories.

GitHub Insights 可用于 GitHub One。 更多信息请参阅“GitHub 的产品”。

本文内容

About repository management

For GitHub Insights to include data from a repository in GitHub Enterprise, you must add the organization that owns the repository to GitHub Insights. For more information, see "Managing organizations."

After you add an organization to GitHub Insights, each repository owned by the organization is automatically imported if the repository:

  • Has at least one commit
  • Is not private
  • Is not archived
  • Has been pushed to in the last 6 months

Repository data is updated through webhooks and periodic synchronizations. You can manually refresh repository data at any time or cancel a data import that is in progress.

您可以创建仓库组来查看相关仓库的合并数据。 您可以在每个指标和报告中按仓库组筛选。

You can exclude specific files from GitHub Insights for a specific repository or for all repositories.

About import times

GitHub Insights imports the last three years of data for each repository. Depending on the size and complexity of your repositories, the initial import can some time, during which GitHub Insights data is incomplete. Typically, the initial import will take one or two days. Large and complex initial imports can take up to one week.

Repository Size Initial import time
< 10,000 commits < 1 hour
10,000 to 40,000 commits < 1 day
> 40,000 commits < 5 days

Once the initial import is complete, subsequent imports from incremental changes should take two minutes or less.

To reduce import times, you can exclude any third party libraries in non-standard folders from GitHub Insights before importing. For more information, see using "Managing exclusion filters."

If you have many large repositories, you can improve initial import times by providing the import server with more cores. Import servers with more cores can perform more parallel import jobs.

Import server cores Parallel import jobs
8 core 4 jobs
16 core 8 jobs
32 core 16 jobs

Importing a large number of pull requests can trigger rate-limiting from GitHub Enterprise. In this case, importing will pause for one hour before resuming. You can temporarily increase the GitHub Enterprise rate limit to improve import times. For more information, see "Configuring rate limits."

Viewing and managing repositories

You can view imported repositories and repositories that are available to import. If an import is in progress, you can see the import's status and a time estimate for the import's completion.

  1. 在 GitHub Insights 中,单击 Settings(设置)

    Settings 选项卡

  2. 在“ Settings(设置)”下,单击 Repositories(仓库)

    仓库选项卡

  3. Optionally, to add a repository which has not been imported, to the right of the repository's name, click Add.

    添加按钮

  4. Optionally, to manually refresh repository data, to the right of the repository's name, click the refresh icon.

    Refresh button

  5. Optionally, to cancel an import in progress, to the right of the repository's name, click Cancel.

    Cancel button

  6. Optionally, to remove an imported repository, to the right of the repository's name, click Remove.

    Remove button

Managing repository groups for reports

You can create a repository group, add or remove repositories to a group, and delete a repository group.

Creating a repository group

  1. 在 GitHub Insights 中,单击 Settings(设置)

    Settings 选项卡

  2. Settings(设置)下,单击 Repo groups(仓库组)

    仓库组选项卡

  3. In the upper-right corner, click Create Group.

    Create Group button

  4. Under "Group Name", type a name for your group.

    Group Name field

  5. Click Create.

Adding a repository to a repository group

  1. 在 GitHub Insights 中,单击 Settings(设置)

    Settings 选项卡

  2. Settings(设置)下,单击 Repo groups(仓库组)

    仓库组选项卡

  3. 在组名称右侧,单击 Edit(编辑)

    编辑按钮

  4. Under "Repositories", use the drop-down menu and select a repository to add to the group.

    Repositories drop-down menu

  5. 单击 Done(完成)

Deleting a repository group

  1. 在 GitHub Insights 中,单击 Settings(设置)

    Settings 选项卡

  2. Settings(设置)下,单击 Repo groups(仓库组)

    仓库组选项卡

  3. 在组名称右侧,单击 Edit(编辑)

    编辑按钮

  4. Click Delete Group.

    Delete Group button

  5. Click Confirm.

Managing exclusion filters

You can create a list of file exclusion rules to omit specified files from all GitHub Insights data. File exclusion rules follow the same rules used in .gitignore files. For more information, see "gitignore" in the Git documentation.

Adding a file exclusion rule for all repositories

Changes to global file exclusions only apply to newly imported data and will not retroactively affect existing data. To apply new exclusion rules to existing data, you can remove and re-add repositories to GitHub Insights.

  1. 在 GitHub Insights 中,单击 Settings(设置)

    Settings 选项卡

  2. Settings(设置)下,单击 Exclude files(排除文件)

    排除文件选项卡

  3. Optionally, under "Exclude files", select Include all binaries.

    Include all binaries checkbox

  4. In the code editor, add a new exclusion rule to the list.

    Code editor to add global exclusion rule

  5. Click Save Changes.

Adding a file exclusion rule for a repository

  1. 在 GitHub Insights 中,单击 Settings(设置)

    Settings 选项卡

  2. Settings(设置)下,单击 Exclude files(排除文件)

    排除文件选项卡

  3. To the right of "Repositories with File Filters", click Add Filter.

    Add Filter button

  4. Use the "Repository" drop-down menu, and select a repository.

    Repository drop-down menu

  5. Optionally, to apply exclusion rules to existing data, select Re-import.

    Re-import checkbox

  6. Optionally, select Include all binaries.

    Include all binaries checkbox

  7. In the code editor, add exclusion rules you want to apply to the repository.

    Code editor to add repository exclusion rule

  8. Click Create Filter.

问问别人

找不到要找的内容?

联系我们