> 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/code-repository/3.0/new-to-harness-code/onboarding-guide.md).

# Get Started

This guide walks you through the essential steps to start using the Harness Code Repository. You set up repositories, work with your code, connect repositories to pipelines, and configure access and security.

If you are new to Harness, create an account first by following [Get started with Harness Platform](/harness-ai/new-to-harness-platform/get-started.md). For core SCM concepts and how Harness Code Repository integrates with Harness Platform, see [Overview](/code-repository/3.0/new-to-harness-code/overview.md).

***

### What you will learn in this topic? <a href="#what-you-will-learn" id="what-you-will-learn"></a>

By the end of this topic, you will be able to:

* [Set up repositories](#step-1-set-up-repositories) by creating, importing, or mirroring them into Harness Code Repository.
* [Work in repositories](#step-2-work-in-repositories) to clone, branch, commit, tag, and raise pull requests.
* [Configure pipelines](#step-3-configure-pipelines) that build and deploy from your repositories.
* [Manage access and security](#step-4-manage-access-and-security) with branch rules, CODEOWNERS, and role-based access control.

***

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* **Code Repository entitlement:** A Harness account with Code Repository entitled. To create or access an account, see [Get started with Harness Platform](/harness-ai/new-to-harness-platform/get-started.md). If Code Repository does not appear in the list, contact your account administrator or [Harness Support](mailto:support@harness.io).
* **Repository permissions:** **Create** and **Edit** permissions on the **Repository** resource in your Harness project. For the full permission list, see the [permissions reference](/harness-platform/3.0/harness-platform-resources/platform-access-control/permissions-reference.md#code-repository). To configure roles, see [Harness Platform access control](/harness-platform/3.0/harness-platform-resources/platform-access-control.md).
* **Git familiarity:** Comfort with cloning, branching, and committing. For a refresher, see the [Git SCM documentation](https://git-scm.com/doc).

***

### Step 1: Set up repositories <a href="#step-1-set-up-repositories" id="step-1-set-up-repositories"></a>

Before you can review code or run pipelines, your code needs to live in Harness Code Repository. Choose the approach that matches where your code is today:

* [Create Repositories](/code-repository/3.0/use-harness-code/manage-repositories/create-repo.md): Start a new repository from scratch for new projects or microservices.
* [Import Repositories](/code-repository/3.0/use-harness-code/manage-repositories/import-repo.md): Migrate existing repositories from another Git provider, such as GitHub, GitLab, or Bitbucket.
* [Mirror Repositories](/code-repository/3.0/use-harness-code/manage-repositories/mirror.md): Create mirrors of repositories from any provider so that you can use Harness CI and CD while the source of truth stays where it is.

***

### Step 2: Work in repositories <a href="#step-2-work-in-repositories" id="step-2-work-in-repositories"></a>

Day-to-day development in Harness Code Repository follows the Git workflow your team already uses, either from the command line or in the Harness UI.

* [Clone](/code-repository/3.0/use-harness-code/collaborate-and-develop/clone-repos.md): Download the repository to your machine to develop and test changes offline.
* [Branch](/code-repository/3.0/use-harness-code/collaborate-and-develop/branch.md), [Commit](/code-repository/3.0/use-harness-code/collaborate-and-develop/commit.md), and [Tag](/code-repository/3.0/use-harness-code/collaborate-and-develop/tag.md): Create branches for feature development, commit changes from the command line or the Harness UI, and tag releases.
* [Pull Requests](/code-repository/3.0/use-harness-code/pull-requests.md): Collaborate through pull requests that carry code reviews, automated checks, and controlled merging.

{% hint style="info" %}
You can perform many Git operations directly in the Harness UI without the command line, which helps team members who prefer a visual interface.
{% endhint %}

***

### Step 3: Configure pipelines <a href="#step-3-configure-pipelines" id="step-3-configure-pipelines"></a>

Connecting a repository to a pipeline is what turns a merged change into a build and a deployment automatically.

* [Set Default Codebase](/code-repository/3.0/use-harness-code/run-pipelines/codebase-from-harness-code.md): Set your Harness CI or CD pipeline to build, test, and deploy code from a Harness Code repository when changes are pushed or pull requests merge.
* [Create Triggers](/code-repository/3.0/use-harness-code/run-pipelines/code-triggers.md): Run a pipeline automatically in response to repository events.

***

### Step 4: Manage access and security <a href="#step-4-manage-access-and-security" id="step-4-manage-access-and-security"></a>

Access controls and scanning keep your repositories compliant as more people begin contributing to them.

* [Enable Rules](/code-repository/3.0/use-harness-code/manage-repositories/rules.md): Require reviews, status checks, or approvals before a merge, and use a `CODEOWNERS` file to assign reviewers based on which files changed.
* [Enable Security](/code-repository/3.0/use-harness-code/manage-repositories/security.md): Turn on secret scanning, vulnerability scanning, and committer email verification.
* [Harness Platform access control](/harness-platform/3.0/harness-platform-resources/platform-access-control.md): Manage broader access through Harness Platform RBAC, using the built-in **Code Admin** role or a custom role.

***

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

<details>

<summary>Code Repository does not appear in the Harness list</summary>

Code Repository must be entitled on your account. Contact your account administrator or Harness Support to confirm entitlement.

</details>

<details>

<summary>Cannot create a repository in a Harness project because the option is unavailable</summary>

Creating a repository requires the Create permission on the Repository resource. Ask an administrator to assign a role that includes it.

</details>

<details>

<summary>A Harness pipeline cannot find the Harness Code repository when configuring the codebase</summary>

The pipeline and the repository must be in the same Harness project. Confirm the project scope, then reselect the repository in the codebase configuration.

</details>

***

### Next steps <a href="#next-steps" id="next-steps"></a>

You have set up Harness Code Repository and can manage your code with the access controls and security scanning your organization requires. You can now collaborate through code reviews, automate builds and deployments, and integrate with other Harness features.

* [Pull Requests](/code-repository/3.0/use-harness-code/pull-requests.md): Review, approve, and merge changes.
* [Code Repository Integrations](/code-repository/3.0/use-harness-code/code-repository-integrations.md): Connect Harness Code Repository to tools such as Jira.
* [Subscriptions & Licenses](/code-repository/3.0/troubleshooting-and-resources/cr-subscription-mgmt.md): Understand storage and bandwidth limits.

{% @harness-feedback/feedback %}
