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

# Sync Git repository

> Sync all history from Git. The repo must already be associated with a Git repo (see import).



## OpenAPI

````yaml post /repos/{repo_id}/sync
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/sync:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
    post:
      tags:
        - Repository Manipulation
      summary: Sync a Git repo to this Diversion repo
      description: >-
        Sync all history from Git. The repo must already be associated with a
        Git repo (see import).
      operationId: src.handlers.integrations.github.handle_repo_github_webhook
      responses:
        '202':
          description: Sync started asynchronously.
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
  responses:
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
          example: 403
        detail:
          type: string
          example: User not authorized to perform the requested action on the resource
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail

````