---
title: "Converts an existing project to store its configuration in version control."
method: POST
path: "/spaces/{spaceIdentifier}/projects/{projectId}/git/convert"
tags: ["Projects"]
---

# Converts an existing project to store its configuration in version control.

`POST /spaces/{spaceIdentifier}/projects/{projectId}/git/convert`

## Path parameters

- `spaceIdentifier` string, required
- `projectId` string, required

## Request body

- ConvertProjectToVersionControlledCommand
  - `ChangeDescription` string, required
  - `CommitMessage` string
  - `InitialCommitBranchName` string
  - `ProjectId` string, required
  - `SpaceId` string, required
  - `VersionControlSettings` GitPersistenceSettingsResource, required
    - `BasePath` string, required
    - `ConversionState` GitPersistenceSettingsConversionStateResource
      - `RunbooksAreInGit` boolean
      - `VariablesAreInGit` boolean
    - `Credentials` GitCredentialUsageResource, required
      - `Type` 'Anonymous' | 'UsernamePassword' | 'Reference' | 'GitHub' | 'SshKey'
    - `DefaultBranch` string, required
    - `ProtectedBranchNamePatterns` string[]
    - `ProtectedDefaultBranch` boolean
    - `SerializationFormat` 'Ocl' | 'Yaml'
    - `Type` 'Database' | 'VersionControlled', required
    - `Url` string, required

## Response `200`

Empty response indicating the Project was converted

- ConvertProjectToVersionControlledResponse

## Other responses

- `400` — Bad request. Either the payload was not structurally valid or business rules did not permit the operation.
- `404` — Not found. One or more of the entities involved in the operation was not found.

---

[API](https://skmtc.net/octopus/apis/octopus-server-api.md) · [All operations](https://skmtc.net/octopus/apis/octopus-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/octopus/octopus-server-api/versions/bc9158facfc7/schema)
