Skip to main content

Cloning

How to clone your Harness Open Source repositories.

HTTPS

  1. In your project, select Repositories, and then select the repository you want to clone.

  2. On the Files page, select Clone.

  3. If this is the first time you've cloned this repository, select Generate Clone Credentials, and then copy the Password (API Token) and store it somewhere secure. Clone credentials are only shown once.

    When you select Generate Clone Credentials, Harness Open Source automatically creates an API token in your account.

    caution

    Tokens carry many privileges; treat your user tokens as passwords and store them securely.

  4. Copy the Harness Open Source repository URL shown on the Clone dropdown, and use it to clone your repository through command line Git or with your preferred Git GUI tool.

    When cloning the repository, you will be prompted for your Harness Open Source user ID and password, which were shown when you generated clone credentials.

  5. Once cloned locally, you can work with your Harness Open Source repository as you would with other Git repositories, by creating commits, pushing to the remote, pulling changes, and more.

Example: Visual Studio Code

Check out this video to learn about working with Harness Open Source repositories in Microsoft Visual Studio Code.

Example: GitHub Desktop

To clone a Harness Open Source repository in GitHub Desktop:

  1. In your Harness Open Source project, select Repositories, and then select the repository you want to clone.

  2. On the Files page, select Clone.

  3. If this is the first time you've cloned this repository, select Generate Clone Credentials, and then copy the Password (API Token) and store it somewhere secure. Clone credentials are only shown once.

    When you select Generate Clone Credentials, Harness Open Source automatically creates an API token in your account.

    caution

    Tokens carry many privileges; treat your user tokens as passwords and store them securely.

  4. Copy the Harness Open Source repository URL shown on the Clone dropdown.

  5. In GitHub Desktop, select Current Repository, select Add, and then select Clone Repository.

  6. On the Clone a Repository dialog, select the URL tab, enter your Harness Open Source repository URL, specify the local path where you want to clone the repo, and then select Clone.

    Cloning a repository from a URL in GitHub Desktop.

  7. On the Authentication Failed dialog, enter your Harness Open Source user ID for the Username, enter your token for the Password, and then select Save and Retry.

    Providing credentials for the Harness Open Source repository in GitHub Desktop.

  8. Once cloned locally, you can work with your Harness Open Source repository as you would with other Git repositories, by creating commits, pushing to the remote, pulling changes, and more.