---
title: git
latest-connect-version: 4.118.0
latest-operator-version: v26.2.6
latest-console-tag: v3.14.0
latest-redpanda-tag: v26.2.7
docname: inputs/git
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: inputs/git.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/inputs/git.adoc
description: Clones a Git repository, reads its contents, then polls for new commits at a configurable interval.
page-cloud-available: "true"
page-cloud-available-url: https://docs.redpanda.com/cloud-data-platform/develop/connect/components/inputs/git/
page-git-created-date: "2025-05-02"
page-git-modified-date: "2026-11-06"
page-generated-sources:
  - include: connect:components:partial$descriptions/inputs/git.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$availability/inputs/git.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
  - include: connect:components:partial$fields/inputs/git.adoc
    generator: null
    version: null
    source: the component specs in https://github.com/redpanda-data/connect
page-generated-content: partial
---

# git

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

<!-- Source: https://docs.redpanda.com/connect/components/inputs/git.md -->

Clones a Git repository, reads its contents, then polls for new commits at a configurable interval.

Introduced in version 4.51.0.

The git input clones the specified repository (or pulls updates if already cloned) and reads the content of the specified file. It periodically polls the repository for new commits and emits a message when changes are detected.

## Metadata

This input adds the following metadata fields to each message:

-   `git_file_path`

-   `git_file_size`

-   `git_file_mode`

-   `git_file_modified`

-   `git_commit`

-   `git_mime_type`

-   `git_is_binary`

-   `git_encoding` (present if the file was base64 encoded)

-   `git_deleted` (only present if the file was deleted)


You can access these metadata fields using function interpolation.

```yml
input:
  label: ""
  git:
    repository_url: "" # No default (required)
    branch: main
    poll_interval: 10s
    include_patterns: []
    exclude_patterns: []
    max_file_size: 10485760
    checkpoint_cache: "" # No default (optional)
    checkpoint_key: git_last_commit
    auth:
      basic:
        username: ""
        password: ""
      ssh_key:
        private_key_path: ""
        private_key: ""
        passphrase: ""
      token:
        value: ""
    auto_replay_nacks: true
```

## Fields

### `auth`

Options for authenticating with your Git repository.

**Type**: `object`

### `auth.basic`

Allows you to specify basic authentication.

**Type**: `object`

### `auth.basic.password`

A password to authenticate with.

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Secrets](https://docs.redpanda.com/connect/configuration/secrets/).

**Type**: `string`

**Default**: `""`

### `auth.basic.username`

The username to use for authentication.

**Type**: `string`

**Default**: `""`

### `auth.ssh_key`

Allows you to specify SSH key authentication.

**Type**: `object`

### `auth.ssh_key.passphrase`

The passphrase for your SSH private key.

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Secrets](https://docs.redpanda.com/connect/configuration/secrets/).

**Type**: `string`

**Default**: `""`

### `auth.ssh_key.private_key`

Your private SSH key content. When using encrypted keys, you must also set a value for `passphrase`.

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Secrets](https://docs.redpanda.com/connect/configuration/secrets/).

**Type**: `string`

**Default**: `""`

### `auth.ssh_key.private_key_path`

The path to your private SSH key file. When using encrypted keys, you must also set a value for `passphrase`.

**Type**: `string`

**Default**: `""`

### `auth.token`

Allows you to specify token-based authentication.

**Type**: `object`

### `auth.token.value`

The token value to use for token-based authentication.

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Secrets](https://docs.redpanda.com/connect/configuration/secrets/).

**Type**: `string`

**Default**: `""`

### `auto_replay_nacks`

Whether to automatically replay rejected messages (negative acknowledgements, or nacks) at the output level. If the cause of rejections persists, leaving this option enabled can result in back pressure.

Set `auto_replay_nacks` to `false` to delete rejected messages. Disabling auto replays can greatly improve memory efficiency of high throughput streams, as the original shape of the data is discarded immediately upon consumption and mutation.

**Type**: `bool`

**Default**: `true`

### `branch`

The repository branch to check out.

**Type**: `string`

**Default**: `main`

### `checkpoint_cache`

Specify a [`cache`](https://docs.redpanda.com/connect/components/caches/about/) resource to store the last processed commit hash. After a restart, Redpanda Connect can then continue processing changes from where it left off, avoiding the need to reprocess all detected updates.

**Type**: `string`

### `checkpoint_key`

The key to use when storing the last processed commit hash in the cache.

**Type**: `string`

**Default**: `git_last_commit`

### `exclude_patterns[]`

A list of file patterns to exclude. For example, you could choose not to read content from certain Git directories or image files: `'.git/**', '**/*.png'`. These patterns take precedence over `include_patterns`.

The following patterns are supported:

-   Glob patterns: `*`, `/**/`, `?`

-   Character ranges: `[a-z]`. Escape any character with a special meaning using a backslash.


**Type**: `array<string>`

**Default**: `[]`

### `include_patterns[]`

A list of file patterns to read from. For example, you could read content from only Markdown and YAML files: `'**/*.md', 'configs/*.yaml'`.

The following patterns are supported:

-   Glob patterns: `*`, `/**/`, `?`

-   Character ranges: `[a-z]`. Escape any character with a special meaning using a backslash.


If this field is left empty, all files are read.

**Type**: `array<string>`

**Default**: `[]`

### `max_file_size`

The maximum size of files to read from (in bytes). Files that exceed this limit are skipped. Set to `0` for unlimited file sizes.

**Type**: `int`

**Default**: `10485760`

### `poll_interval`

How frequently this input polls the Git repository for changes, as a duration between polling attempts.

**Type**: `string`

**Default**: `10s`

```yaml
# Examples:
poll_interval: 10s
```

### `repository_url`

The URL of the Git repository to clone.

**Type**: `string`

```yaml
# Examples:
repository_url: https://github.com/username/repo.git
```