> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/use-harness-platform/connectors/code-repositories/ref-source-repo-provider/git-connector-settings-reference.md).

# Git connector settings reference

This topic provides settings and permissions for the platform-agnostic Git connector. For specialized connectors for popular Git platforms, like GitHub, go to [Code Repo Connectors](/harness-platform/use-harness-platform/connectors/code-repositories/ref-source-repo-provider.md).

### Overview settings <a href="#overview-settings" id="overview-settings"></a>

* **Name:** The unique name for this connector. Harness generates an **Id** ([Entity Identifier](/harness-platform/use-harness-platform/references/entity-identifier-reference.md)) based on the **Name**. You can edit the **Id** during initial connector creation. Once you save the connector, the **Id** is locked.
* **Description:** Optional text string.
* **Tags:** Optional labels you can use for filtering. For details, go to the [Tags reference](/harness-platform/use-harness-platform/tags/overview.md#create-tags-for-pipelines).

### Details settings <a href="#details-settings" id="details-settings"></a>

The **Details** settings specify which Git account or repository you want this connector to connect to, whether to connect over HTTP or SSH, and the URL to use.

#### URL Type <a href="#url-type" id="url-type"></a>

Select **Account** to connect an entire Git account or organization. This option lets you use one connector to connect to all repositories in the specified account. Make sure you have at least one repo in the account; you need a repo to test the connection and save the connector.

Select **Repository** to connect to a single, specific repo in a Git account.

#### Connection Type <a href="#connection-type" id="connection-type"></a>

Select the protocol, **HTTP** or **SSH**, to use for cloning and authentication. The **Connection Type** determines the URL format required for the [Git Account or Repository URL field](#git-account-or-repository-url). It also determines the **Authentication** method you must use in the [Credentials settings](#credentials-settings).

Both connection types support two-factor authentication.

{% hint style="info" %}
If you select **SSH**, make sure HTTPS is enabled on port 443. This is the protocol and port used by the Harness connection test for Git connectors.
{% endhint %}

#### Git Account or Repository URL <a href="#git-account-or-repository-url" id="git-account-or-repository-url"></a>

Enter the URL for the Git account or repository that you want to connect to. The required value is determined by the **URL Type** and **Connection Type**.

If you selected **Git Repository** for **URL Type**, enter the full URL for the repo.

If you selected **Git Account** for **URL Type**, enter the URL without the repo name. When you use this Connector in a Harness setting you will be prompted to provide a repo name.

{% tabs %}
{% tab title="URL Type: Account" %}
In the **Git Account URL** field, provide only the account-identifying portion of the Git URL, such as `https://github.com/my-account`. Do not include a repo name in the URL.

The URL format depends on the Git provider and **Connection Type**:

* HTTP format: `https://<git-provider>.com/USERNAME`
* SSH format: `git@<git-provider>.com:USERNAME`

{% hint style="warning" %}
For SSH format, the URL is valid only if it starts with the prefix **git@**.
{% endhint %}

#### Test Repository <a href="#test-repository" id="test-repository"></a>

This field is only required if the **URL Type** is **Account**. Provide the name of a repo in your Git account that Harness can use to test the connector. Harness uses this repo path to validate the connection only. When you use this connector in a pipeline, you'll specify a true code repo in your pipeline configuration or at runtime.
{% endtab %}

{% tab title="URL Type: Repository" %}
In the **Git Repository URL** field, provide the complete URL to the Git repository that you want this connector to point to.

The URL format depends on the Git provider and **Connection Type**:

* HTTP format: `https://<git-provider>.com/USERNAME/REPO_NAME`
* SSH format: `git@<git-provider>.com:USERNAME/REPO_NAME`

{% hint style="warning" %}
For SSH format, the URL is valid only if it starts with the prefix **git@**.
{% endhint %}
{% endtab %}
{% endtabs %}

### Credentials settings <a href="#credentials-settings" id="credentials-settings"></a>

Provide authentication credentials for the connector. The **Connection Type** you chose in the [Details settings](#details-settings) determines the authentication method.

{% tabs %}
{% tab title="Username and Password" %}
The **HTTP** Connection Type requires **Username** and **Password** authentication for all accounts and repos, including read-only repos.

In the **Username** field, enter the Git account username. You can use either plaintext or a [Harness encrypted text secret](/harness-platform/use-harness-platform/secrets/add-use-text-secrets.md).

In the **Password** field, provide the account password or a personal access token. Passwords and tokens are stored as [Harness encrypted text secrets](/harness-platform/use-harness-platform/secrets/add-use-text-secrets.md).

If your Git account uses two-factor authentication, you must provide a personal access token for the **Password**.
{% endtab %}

{% tab title="SSH Key" %}
The **SSH** Connection Type requires an **SSH Key** in PEM format. OpenSSH keys are not supported. In Harness, SSH Keys are stored as [Harness SSH credential secrets](/harness-platform/use-harness-platform/secrets/add-use-ssh-secrets.md). When creating an SSH credential secret for a code repo connector, the SSH credential's **Username** must be `git`. Always save the ssh key as a file secret.

{% hint style="info" %}
If you use the `keygen` command to generate an SSH key, include arguments such as `rsa` and `-m PEM` to ensure your key is properly formatted and uses the RSA algorithm. For example, this command creates a PEM-formatted SSHv2 key:

```
ssh-keygen -t rsa -m PEM
```

Make sure to follow the prompts to finish creating the key. For more information, go to the Linux [ssh-keygen man page](https://linux.die.net/man/1/ssh-keygen).

For GitHub repos, your SSH key must use ECDSA or Ed25519 instead of RSA. As an example, the following `ssh-keygen` command generates a PEM-formatted SSH key in ECDSA:

```
ssh-keygen -t ecdsa -b 256 -f /home/user/Documents/ECDSA/key -m pem
```

For more information about GitHub's deprecation of RSA support, go to the GitHub announcement on [Improving Git protocol security on GitHub](https://github.blog/2021-09-01-improving-git-protocol-security-github/#when-are-these-changes-effective).
{% endhint %}
{% endtab %}
{% endtabs %}

### Connectivity Mode settings <a href="#connectivity-mode-settings" id="connectivity-mode-settings"></a>

Select whether you want Harness to connect directly to your Git account or repo, or if you want Harness to communicate with your Git account or repo through a delegate. If you plan to use this connector with [Harness Cloud build infrastructure](/continuous-integration/use-harness-ci/use-harness-ci/set-up-build-infrastructure/use-harness-cloud-build-infrastructure.md), you must select **Connect through Harness Platform**.

{% hint style="info" %}
For private network connectivity options with Harness Cloud, see [Private network connectivity options](/harness-platform/use-harness-platform/references/private-network-connectivity/private-network-connectivity.md).
{% endhint %}

#### Delegates Setup <a href="#delegates-setup" id="delegates-setup"></a>

If you select **Connect through a Harness Delegate**, you can select **Use any available Delegate** or **Only use Delegates with all of the following tags**.

If you want to use specific delegates, you must identify those delegates. For more information, go to [Use delegate selectors](/harness-platform/use-harness-platform/delegates/delegate/manage-delegates/select-delegates-with-selectors.md).

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

Before Harness syncs with your Git repo, it runs a connection test to confirm that the connector's settings are valid. If the connection fails, Harness won't sync with your Git repo.

If your connector uses the **SSH** [Connection Type](#connection-type), and the connection test fails due to an unknown SCM request failure, make sure HTTPS is enabled on port 443. This is the protocol and port used by the Harness connection test for Git connectors.
