---
title: "Get Git Configuration"
method: GET
path: "/api/v1/git/config"
tags: ["Git Configuration"]
---

# Get Git Configuration

`GET /api/v1/git/config`

## Request

- Base URL: `https://public-api.linearb.io`
- URL: `https://public-api.linearb.io/api/v1/git/config`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/linearb/apis/linearb-api/docs/api/v1/git/config/get.ts> (a function with typed inputs; its response is checked against the schema)

Reads the organization-wide default of every repository setting section, and the organization-wide only sections (bot-authored pull request attribution, included file extensions, active branches duration, issue start time). A repository without an override of a section follows this default

## Response `200`

Successful Response

- GitConfigResponseModel: The organization-wide default of every repository setting section, and the organization-wide only sections.
  - `settings` GitSettingsModel, required: The organization-wide Git setting sections.
    - `releases_detection` ReleasesDetectionModel, required: How releases are detected.
      - `method` 'tags' | 'pr_to_branch' | 'merge_to_branch' | 'api' | 'deployment', required: `tags`: release tags; `pr_to_branch`: pull requests to a dedicated branch; `merge_to_branch`: direct merges to a dedicated branch; `api`: releases reported via the API. `deployment` is read-only
      - `pattern` string, nullable: Regular expression for the release tags (`tags`) or the dedicated branch (`pr_to_branch`, `merge_to_branch`); required for those, not allowed with `api`
    - `draft_pull_requests` DraftPullRequestsModel, required: How draft pull requests are recognized; a pull request matching either rule is a draft.
      - `labels` string[]: Labels that mark a pull request as a draft (case-insensitive)
      - `title_pattern` string, nullable: Regular expression matched against the title; `null` or empty: no title rule
    - `default_branch` DefaultBranchModel, required: The branch every merge comparison is based on.
      - `branch_name` string, nullable: `null` uses the provider's default branch
    - `exclude_branches` PatternsModel, required: A list of regular expressions. Changing it recomputes history asynchronously.
      - `patterns` string[]: Regular expressions, one per entry
    - `exclude_base_branches` PatternsModel, required: A list of regular expressions. Changing it recomputes history asynchronously.
      - `patterns` string[]: Regular expressions, one per entry
    - `exclude_file_extensions` PatternsModel, required: A list of regular expressions. Changing it recomputes history asynchronously.
      - `patterns` string[]: Regular expressions, one per entry
    - `coding_time_strategy` CodingTimeStrategyModel, required: When coding time starts.
      - `method` 'first_commit' | 'issue_state_pr', required: `first_commit`: the first commit on the branch; `issue_state_pr`: the linked issue moving to in progress
    - `bot_pr_attribution` BotPrAttributionModel, required: Who a pull request opened by a bot is attributed to.
      - `method` 'merge_actor' | 'assignee' | 'none', required: `merge_actor`: whoever merged it; `assignee`: its assignees; `none`: left on the bot
    - `include_file_extensions` IncludeFileExtensionsModel, required: The files scanned: only files matching one of the patterns, out of those left after the excluded file extensions. Changing it recomputes history asynchronously.
      - `patterns` string[]: Regular expressions, one per entry; `.*$` includes every file
    - `active_branches_duration` ActiveBranchesDurationModel, required: How long a branch stays active after its last update before it becomes stale.
      - `days` integer, required: Days, from 3 to 14
    - `issue_start_time` IssueStartTimeModel, required: Which transition to the in progress state is the issue start time; it affects coding time and MTTR.
      - `method` 'first_transition' | 'last_transition', required: `first_transition`: the first move to in progress; `last_transition`: the last one

## Other responses

- `400`: Bad Request - an unknown section, an invalid value or regular expression
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `405`: Method Not Allowed
- `409`: Conflict
- `422`: Validation Error
- `500`: Internal Server Error
- `504`: Gateway Timeout

---

[API](https://skmtc.dev/linearb/apis/linearb-api.md) - [All operations](https://skmtc.dev/linearb/apis/linearb-api/llms.txt) - [OpenAPI document](https://skmtc.dev/linearb/apis/linearb-api/revisions/3aea06710db6?raw)
