---
title: "Get Git repository by ID"
method: GET
path: "/gits/{id}"
tags: ["Git"]
---

# Get Git repository by ID

`GET /gits/{id}`

Get detailed information about a Git repository

## Path parameters

- `id` string, required — MongoDB ObjectId represented as a hexadecimal string

## Response `200`

Git repository details

- object
  - `code` integer
  - `message` string
  - `data` object
    - `_id` string — MongoDB ObjectId represented as a hexadecimal string
    - `url` string — Git repository URL
    - `name` string — Git repository name
    - `auth_type` string — Authentication type (e.g., http, ssh)
    - `username` string — Git username for authentication
    - `password` string — Git password or token for authentication
    - `current_branch` string — Current branch of the repository
    - `status` string — Status of the repository (e.g., cloning, pulling, error)
    - `error` string — Error message if any
    - `refs` GitRef[] — Git references (branches, tags)
      - `name` string — Reference name
      - `type` string — Reference type (branch, tag)
      - `hash` string — Git commit hash
    - `refs_updated_at` string, date-time — When refs were last updated
    - `clone_logs` string[] — Logs from the clone operation
    - `auto_pull` boolean — Whether to automatically pull before running tasks
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `created_by` string — MongoDB ObjectId represented as a hexadecimal string
    - `updated_by` string — MongoDB ObjectId represented as a hexadecimal string

## Changes

- **2025-03-03** `14e4eafea538` — 1 breaking, 3 warning, 1 info
  - the response's body type/format changed from `object`/`` to ``/`` for status `200`
  - removed the optional property `code` from the response with the `200` status
  - removed the optional property `data` from the response with the `200` status
  - removed the optional property `message` from the response with the `200` status
  - …1 more
- **2025-03-02** `526e5bdf6dee` — 1 breaking, 4 warning, 6 info
  - added the pattern `^[0-9a-fA-F]{24}$` to the `path` request parameter `id`
  - removed the optional property `data/Git` from the response with the `200` status
  - removed the optional property `data/spiders` from the response with the `200` status
  - removed the optional property `error` from the response with the `200` status
  - …7 more

[Change history](https://skmtc.dev/crawlab-team/apis/crawlab-api/changes/gits/:id/get.md)

---

[API](https://skmtc.dev/crawlab-team/apis/crawlab-api.md) · [All operations](https://skmtc.dev/crawlab-team/apis/crawlab-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/crawlab-team/crawlab-api/revisions/14e4eafea538/schema)
