Connect to a Git Repo

Updated 2 months ago by Rashmi Nanda Sahoo

Harness Code Repositories Connectors connect your Harness account with your Git platform accounts to synchronize your Harness account and Applications and pull important files, such as Helm charts, Kubernetes manifests, and Terraform scripts.

Connect to Your Git Repositories

You can add a Code Repo Connector at the Account, Org, or Project scope. This topic will explain how to add it at the Project scope. The process is same for Org and Account. You can choose to add below Code Repo Connectors:

Permissions

In general, the Git provider user account you use to set up the Connector needs the same permissions it would need if you were working from Git.

So, if you are using the Harness Connector to pull manifests from a repo, the user account you use in the Connector must have a read repo permission for your Git provider.

For Harness Git Experience, see Source Code Manager Settings.

Add a Git Repo

For more details on the settings to create this connector, see Git Connector Settings Reference.
  1. Open a Harness Project.
  2. In Project Setup, click Connectors.
  3. Click New Connector, and click Git in Code Repositories. The Git settings appear.
  4. In Name, enter a name for this connector.
  5. Select Account (which is an Organization) or Repository in URL Type.
  6. Select Connection Type as HTTP or SSH.
  7. Enter the Git Account (org) or repo URL.
  8. If you selected Account, in Test Repository, enter a repository name to test the connection.
  9. Click Continue.
  10. In Credentials, Enter your Username.
  11. In Secret Key you can either create a new Encrypted Text or use an existing one.
  12. Click Continue.
  13. In Setup Delegates, you can choose Connect via any delegate or Connect only via delegates which has all of the following tags.
  14. Click Save and Continue.
  15. Once the Test Connection succeeds, click Finish. The Connector is listed in Connectors.

Add GitHub Repo

For more details on the settings to create this connector, see GitHub Connector Settings Reference.
  1. Open a Harness Project.
  2. In Project Setup, click Connectors.
  3. Click New Connector, and click GitHub in Code Repositories. The GitHub Connector settings appear.
  4. In Name, enter a name for this connector.
  5. Select Account or Repository in URL Type.
  6. Select Connection Type as HTTP or SSH.
  7. Enter your GitHub Account URL.
  8. In Test Repository, enter your repository name to test the connection.
  9. Click Continue.
  10. In Credentials, Enter your Username.
  11. In Secret Key you can either create a new Encrypted Text or use an existing one.
  12. Click Continue.
  13. In Setup Delegates, you can choose Connect via any delegate or Connect only via delegates which has all of the following tags.
  14. Click Save and Continue.
  15. Once the Test Connection succeeds, click Finish. The Connector is listed in Connectors.

Add AWS CodeCommit Repo

For details on settings and permissions, see AWS CodeCommit Connector Settings Reference.
  1. Open a Harness Project.
  2. In Project Setup, click Connectors.
  3. Click New Connector, and click AWS CodeCommit in Code Repositories. The AWS CodeCommit settings appear.
  4. In Name, enter a name for this connector.
  5. Select Region or Repository.
  6. Enter the repository URL in AWS CodeCommit Repository URL.
  7. Click Save and Continue.
  8. Enter Access Key for your account.
  9. In Secret Key you can either create a new Encrypted Text or use an existing one.
  10. Click Save and Continue.
  11. Once the Test Connection succeeds, click Finish. The Connector is listed in Connectors.

Add a Bitbucket Repo

For more details on the settings to create this connector, see Bitbucket Connector Settings Reference.
  1. Open a Harness Project.
  2. In Project Setup, click Connectors.
  3. Click New Connector, and click Bitbucket in Code Repositories. The Bitbucket settings appear.
  4. In Name, enter a name for this connector.
  5. Select Account or Repository in URL Type.
  6. Select Connection Type as HTTP or SSH.
  7. Enter your Bitbucket Account URL.
  8. In Test Repository, enter your repository name to test the connection.
  9. Click Save and Continue.
  10. Enter your Username.
  11. In Secret Key you can either create a new Encrypted Text or use an existing one.
  12. Click Continue.
  13. In Setup Delegates, you can choose Connect via any delegate or Connect only via delegates which has all of the following tags.
  14. Click Save and Continue.
  15. Once the Test Connection succeeds, click Finish. The Connector is listed in Connectors.

Add GitLab Repo

For more details on the settings to create this connector, see GitLab Connector Settings Reference.
  1. Open a Harness Project.
  2. In Project Setup, click Connectors.
  3. Click New Connector, and click GitLab in Code Repositories. The GitLab Connector settings appear.
  4. In Name, enter a name for this connector.
  5. Select Account or Repository in URL Type.
  6. Select Connection Type as HTTP or SSH.
  7. Enter your GitLab Account URL.
  8. In Test Repository, enter your repository name to test the connection.
  9. Click Continue.
  10. In Credentials, Enter your Username.
  11. In Secret Key you can either create a new Encrypted Text or use an existing one.
  12. Click Continue.
  13. In Setup Delegates, you can choose Connect via any delegate or Connect only via delegates which has all of the following tags.
  14. Click Save and Continue.
  15. Once the Test Connection succeeds, click Finish. The Connector is listed in Connectors.


Please Provide Feedback