> 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 module. You set up repositories, work with your code, connect repositories to pipelines, and configure access and security.

If you are new to Harness, go to [Get started with Harness Platform](/harness-ai/new-to-harness-platform/get-started.md) to create an account before you onboard to Code. Go to [Overview and key concepts](/code-repository/new-to-harness-code/overview.md) to review core SCM concepts and how Harness Code integrates with the Harness Platform.

***

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

* **Set up repositories:** Create, import, or mirror repositories into Harness Code.
* **Work in repositories:** Clone, branch, commit, tag, and raise pull requests.
* **Configure pipelines:** Connect repositories to Harness CI and CD pipelines.
* **Manage access and security:** Apply branch rules, CODEOWNERS, and role-based access control.

***

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

* **Code Repository enabled:** You need a Harness account with Code Repository entitled. Go to [Get started with Harness Platform](/harness-ai/new-to-harness-platform/get-started.md) to create or access an account.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>CONTACT HARNESS SUPPORT:</strong></p><p>If Code Repository does not appear, contact your account administrator or <a href="mailto:support@harness.io">Harness Support</a>.</p></div>
* **Repository permissions:** You need **Create** and **Edit** on **Repository** in your Harness project. Go to the [permissions reference](/harness-ai/use-harness-platform/platform-access-control/permissions-reference.md#code-repository) to review the permission list, and to [RBAC in Harness](/harness-ai/use-harness-platform/platform-access-control.md) to configure roles.
* **Git familiarity:** You should be comfortable with cloning, branching, and committing. Go to the [Git SCM documentation](https://git-scm.com/doc) to review the basics.

***

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

Choose how you want to bring code into Harness Code:

* [Create fresh repos](/code-repository/use-harness-code/manage-repositories/create-repo.md): Start a new repository from scratch for new projects or microservices.
* [Import repos](/code-repository/use-harness-code/manage-repositories/import-repo.md): Migrate existing repositories from another Git provider, such as GitHub, GitLab, or Bitbucket.
* [Mirror repos](/code-repository/use-harness-code/manage-repositories/mirror.md): Create mirrors of repositories from any provider so 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>

Once your repositories exist, you work with them as you would with any other Git-based SCM tool:

* [Clone your repo to work locally](/code-repository/use-harness-code/collaborate-and-develop/clone-repos.md): Download the repository to your machine to develop and test changes offline.
* [Branch, commit, and tag](/code-repository/use-harness-code/collaborate-and-develop/branch.md): Create branches for feature development, then [commit](/code-repository/use-harness-code/collaborate-and-develop/commit.md) changes from the command line or the Harness UI and [tag](/code-repository/use-harness-code/collaborate-and-develop/tag.md) releases.
* [Create, review, and merge pull requests](/code-repository/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>

Connect your Harness Code repositories to CI and CD pipelines to automate delivery:

* [Configure pipelines to use Harness Code repos](/code-repository/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.
* [Configure triggers](/code-repository/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>

Control who can reach your repositories and what they can do:

* [Configure rules and CODEOWNERS](/code-repository/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/use-harness-code/manage-repositories/security.md): Turn on secret scanning, vulnerability scanning, and committer email verification.
* [Set up role-based access control](/harness-ai/use-harness-platform/platform-access-control.md): Manage broader access through Harness Platform RBAC, using the built-in **Code Admin** role or a custom role.

The following video walks through access control in Harness Code:

{% embed url="<https://www.youtube.com/watch?v=SaH27_UgAxA>" %}

***

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

<details>

<summary>Code Repository does not appear in the Harness module 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 modules.

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