Repositories are where your code is stored. When developers make changes to code in a Harness Code repository, those changes are tracked with version control. Harness Code fosters collaboration and governance with code reviews, approvals, status checks, and more.
You can create repositories directly in Harness Code or import repositories from other Git SCM providers.
Create a repository
- Go to the Harness project where you want to create a repo.
- Go to the Code module and select New Repository.
- Enter a repository Name and optional Description.
- Harness Code repositories are initialized with a
mainbranch, unless you specify a different name for the base branch. To change the base branch name, select
mainand enter a name for the base branch.
- Select your preference for visibility (Public or Private).
- Optionally, you can add a License, .gitignore, or README file to your repository.
- Select Create Repository.
Work with repositories
After creating a repository, you can:
- Clone your repository.
- Create branches and tags.
- Commit changes and open pull requests.
- Configure branch rules.
- Use Harness Code repositories in your Harness pipelines.
- Set up triggers to automatically run pipelines based on activity in your Harness Code repositories.
- Configure webhooks to integrate your repositories with third-party applications.