Git Branches

Contains APIs related to Git Sync Branch

Lists branches with their status(Synced, Unsynced) by Git Sync Config Id for the given scope

Request
Security:
ApiKey (readwrite)
query Parameters
yamlGitConfigIdentifier
required
string

Git Sync Config Id

accountIdentifier
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

page
integer <int32>
Default: 0

Indicates the number of pages. Results for these pages will be retrieved.

size
integer <int32>

The number of the elements to fetch

searchTerm
string
Default: ""

Search Term

branchSyncStatus
string

Used to filter out Synced and Unsynced branches

Enum: "SYNCED" "SYNCING" "UNSYNCED"
Responses
400

Bad Request

500

Internal Server Error

default

Returns a list of branches along with their status within the given scope

get/ng/api/git-sync-branch/listBranchesWithStatus
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/git-sync-branch/listBranchesWithStatus?yamlGitConfigIdentifier=string&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&page=0&size=0&searchTerm=&branchSyncStatus=SYNCED' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Sync the content of new Git Branch into harness with Git Sync Config Id

Request
Security:
ApiKey (readwrite)
query Parameters
repoIdentifier
required
string

Git Sync Config Id

accountIdentifier
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

branch
string

Branch Name

Responses
400

Bad Request

500

Internal Server Error

default

Returns True if the new Git Branch is successfully synced into Harness

post/ng/api/git-sync-branch/sync
Request samples
curl -i -X POST \
  'https://app.harness.io/gateway/ng/api/git-sync-branch/sync?repoIdentifier=string&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&branch=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}