# Git Insights

Git Insights enables you to quantify and optimize Git collaboration. It provides crucial metrics like pull request cycle time and merge frequency.

:::important[Git provider requirements]

Git Insights is only available if your repository is hosted on one of three Git providers:

- GitHub
- GitLab
- Bitbucket.

:::

## Configuring webhooks for Git Insights

To use Git Insights, you need to [register a webhook](/bitrise-platform/integrations/webhooks/adding-incoming-webhooks) with your Git provider. Without a webhook, Bitrise can't access your pull request data.

:::important[Updating existing webhooks]

If you already have webhooks registered to [automatically trigger builds](/bitrise-ci/run-and-analyze-builds/build-triggers/configuring-build-triggers) on Bitrise, check that their permissions match the requirements of Git Insights and update them if necessary.

:::

Git Insights requires the following webhook permission from the three supported Git providers:

- **[GitHub](https://docs.github.com/en/webhooks/using-webhooks/editing-webhooks)**: Pushes, Pull requests.

  ![github-webhook-permissions.png](/img/_paligo/uuid-7a681d2b-732b-b061-0eb1-ecd158c0a9b9.png)
- **[GitLab](https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#configure-a-webhook-in-gitlab)**: Push events/All branches, Merge request events.

  ![gitlab-webhook-settings.png](/img/_paligo/uuid-130fe737-4629-1dfa-3234-9c03ad22f5dc.png)
- **[Bitbucket](https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/)**: Repository: Push; Pull request: Created, Updated, Merged.

## Accessing Git Insights

To access Git Insights:

1. Log in to Bitrise.
1. Select a Workspace in the top right corner of the Dashboard.
1. On the menubar on the top, select **Insights**.
1. On the left, select **Git**.

   ![git_-insights.png](/img/_paligo/uuid-33016129-6c3c-5427-c4ac-8dca1c01770d.png)

## Using Git Insights

Git Insights can show aggregated metrics for all apps of a Workspace, or metrics for each individual app:

![apps-filter.png](/img/_paligo/uuid-0b5537ea-42ab-780f-cd11-05072d508a72.png)

You can also filter for the target branch of the pull requests: once you selected an app, click **Add filter** next to the app dropdown menu.

Git Insights offers two main metrics for now: cycle time and merge frequency.

**Cycle time** means the time elapsed between opening a PR and merging it. It is further broken down into two separate metrics:

- **Development time**: The time between the first commit of a PR and opening the PR.
- **Review time**: The time it takes from opening the PR to the PR being merged into the target branch.

**Merge frequency** means the number of times a PR has been merged in a given period.

You can see these metrics on the main chart where you can switch between displaying cycle time and merge frequency:

![git-main-chart.png](/img/_paligo/uuid-ef391d65-8868-242c-c6b6-380d117676b7.png)

The **Breakdown** tab allows users to view detailed information for each application or target branch by time period. For example, you can check the total merge frequency for a target branch in any given week over a month:

![breakdown-tab.png](/img/_paligo/uuid-7bf083ec-108e-2c84-cb3e-b47a85b69a48.png)

The content depends on your settings and filters:

- If you look at the aggregated data of all applications, the **Breakdown** tab displays data on a per application basis.
- If you filter the data for a specific application, the **Breakdown** tab displays data on a per target branch basis.

The **Related PRs** tab shows relevant metrics for each individual PR that is represented in the dataset. By clicking anywhere in the row, you can go to the PR's page.
