Skip to main content

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.

Overview settings

  • Name: The unique name for this connector. Harness generates an Id (Entity Identifier) 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.

Details settings

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

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

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. It also determines the Authentication method you must use in the Credentials settings.

Both connection types support two-factor authentication.

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.

Git Account or Repository URL

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.

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
warning

For SSH format, the URL is valid only if it starts with the prefix git@.

Test Repository

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.

Credentials settings

Provide authentication credentials for the connector. The Connection Type you chose in the Details settings determines the authentication method.

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.

In the Password field, provide the account password or a personal access token. Passwords and tokens are stored as Harness encrypted text secrets.

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

Connectivity Mode settings

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, you must select Connect through Harness Platform.

tip

The Secure Connect option is for Secure Connect with Harness Cloud.

Delegates Setup

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.

Troubleshooting

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, 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.