Add Source Repo Providers
This topic outlines how to synchronize your Harness account and applications with one or more Git repositories (GitHub, Bitbucket, GitLab, CodeCommit, etc.), by adding Source Repo Providers in Harness. It covers:
- Before You Begin
- Step 1: Review Harness Sync Options
- Step 2: Determine Harness Sync Directions
- Next Steps
Once a repo is added and synced, any changes you make in your repo or in Harness will automatically be synced.
Before You Begin
Step 1: Review Harness Sync Options
You can use multiple repositories. You can sync Harness at the account level to one repo or branch, and you can sync each Harness Application with its own repo or branch. Other available sync options include:
- One Harness Application can be on one repo/branch.
- Multiple Harness Applications can be on one repo, all can be in one branch, or each Application in its own branch.
- When you create a new Harness Application, you can choose to sync it with a repo.
- If you create a new Harness Application in an already synced repo (by adding the required files and folders), Harness will sync and add the new Harness Application.
- If you move a synced Harness Application from one repo to a new repo, Harness will accept changes from the new repo only.
- Admins that want access to all synced Harness Applications in a Git repo must have an admin account in the repo that contains all the applications.
Step 2: Determine Harness Sync Directions
As detailed in Sync Scenarios Overview, you can sync Harness with your repo in either of two directions: Git to Harness, or Harness to Git. You can also set up bidirectional sync to enable both directions.
Here is a visual summary of Git to Harness sync:
Here is a visual summary of Harness to Git sync:
- One Harness Application cannot be in multiple repos.