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

# Git Clone

> Clones a remote Git repository to the local rules directory. Use this to initialize your rules from an existing repository. The repository URL and optional authentication credentials are provided in the request body.



## OpenAPI

````yaml POST /git/clone
openapi: 3.1.0
info:
  title: FinWatch API
  description: >-
    FinWatch REST API for real-time transaction monitoring, rule evaluation, and
    instruction management.
  version: 1.0.0
  contact:
    name: FinWatch Support
    url: https://docs.finwatch.finance
servers:
  - url: http://localhost:8081
    description: Local development server
security: []
tags:
  - name: Transactions
    description: >-
      Inject transactions for evaluation, retrieve transaction details, and
      handle webhook events.
  - name: Instructions
    description: >-
      Create, list, retrieve, and delete monitoring rules written in
      Watchscript.
  - name: Git
    description: Manage rules with Git for version control — status, pull, push, and clone.
paths:
  /git/clone:
    post:
      tags:
        - Git
      summary: Git Clone
      description: >-
        Clones a remote Git repository to the local rules directory. Use this to
        initialize your rules from an existing repository. The repository URL
        and optional authentication credentials are provided in the request
        body.
      operationId: gitClone
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GitCloneRequest'
            example:
              url: https://github.com/your-org/finwatch-rules.git
              branch: main
              token: ghp_xxxxxxxxxxxx
      responses:
        '200':
          description: Clone successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GitCloneResponse'
              example:
                message: Repository cloned successfully
                path: /rules
                branch: main
        '400':
          description: Invalid request or repository already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Failed to clone repository
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    GitCloneRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: Remote repository URL
        branch:
          type: string
          description: Branch to clone (defaults to main)
          default: main
        token:
          type: string
          description: Authentication token (for private repositories)
    GitCloneResponse:
      type: object
      properties:
        message:
          type: string
          description: Clone status message
        path:
          type: string
          description: Local path where repository was cloned
        branch:
          type: string
          description: Branch that was cloned
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          description: Error code

````