Skip to content

Git scmInstances

Request

Updates an instance of Git SCM.
url* - Enter one repository URL and branch/ tag/ commit ID in individual fields or one or more repository URLs separated by comma.
You can include a branch, tag, or commit ID notation as part of the URL.
userName/password - userName/password for authenticated access to the repository. Leave blank for anonymous or SSH access.
branch/commitId/tag - branch, tag or commit ID. Specify one of these values. Or leave blank to sync to the master branch.
These three fields will be considered only when single URL is provided without branch/ tag/ commit ID properties in the URL.
includeSubmodules - (Optional, Boolean, default: true) Controls whether submodules are included during sync.
expansionLevel - (Optional, Integer, default: 1, values: 1/2/3) Control archive extraction depth: 1=None (no extraction), 2=Top-level archives only, 3=Recursive (nested archives).
deleteArchiveAfterExpand - (Optional, Boolean, default: false) Delete archive files after extraction to save disk space. Note: This field is only applicable when expansionLevel is 2 or 3.
archiveDirSuffix - (Optional, String, max: 20 chars) Suffix to be added to the expanded folder. Value cannot be more than 20 characters and cannot contain the following special characters: \ / : * ? " < > | \0 (Example: _Expanded). Note: This field is only applicable when expansionLevel is 2 or 3.

Security
bearerAuth
Query
projectIdinteger, (int64), >= 1required

ID of the project

Example:projectId=1
instanceIdinteger, (int64), >= 0required

ID of the SCM instance

Example:instanceId=0
Bodyapplication/jsonrequired
urlstring, [ 0 .. 65535 ] charactersrequired

url

Example:"E.g. https://host.xz/path/to/repo.git or https://host.xz/path/to/repo.git~~branch1 or user@host:path/repo.git>>cmID123 or https://host.xz/path/to/rep
userNamestring, [ 0 .. 255 ] characters

userName

Example:"abc"
passwordstring, [ 0 .. 255 ] characters

password

Example:"abc"
branchstring, [ 0 .. 255 ] characters

branch

Example:"master"
commitIdstring, [ 0 .. 255 ] characters

commitId

tagstring, [ 0 .. 255 ] characters

tag

deleteArchiveAfterExpandboolean

deleteArchiveAfterExpand

Default:false
Example:true
expansionLevelinteger, (int32)

expansionLevel

Default:1
Enum:123
Example:2
archiveDirSuffixstring, [ 0 .. 20 ] characters

archiveDirSuffix

Example:"_Expanded"
includeSubmodulesboolean

Include submodules during sync.

Default:true
Example:true
curl -i -X PUT \
  'https://codeinsightapi.redocly.app/_mock/swagger/scmInstances/Git?projectId=1&instanceId=0' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "E.g. https://host.xz/path/to/repo.git or https://host.xz/path/to/repo.git~~branch1 or user@host:path/repo.git>>cmID123 or https://host.xz/path/to/repo.git^^tag1.1 or https://host.xz/path/to/repo.git~~branch1**FolderA or user@host:path/repo.git>>cmID123**FolderB or https://host.xz/path/to/repo.git^^tag1.1**FolderC or https://host.xz/path/to/repo.git**FolderD",
    "userName": "abc",
    "password": "abc",
    "branch": "master",
    "commitId": "string",
    "tag": "string",
    "deleteArchiveAfterExpand": true,
    "expansionLevel": 2,
    "archiveDirSuffix": "_Expanded",
    "includeSubmodules": true
  }'

Responses

Ok