azuredevops_git_repository_file

Manage files within an Azure DevOps Git repository.

Example Usage

resource "azuredevops_project" "example" {
  name               = "Example Project"
  visibility         = "private"
  version_control    = "Git"
  work_item_template = "Agile"
}

resource "azuredevops_git_repository" "example" {
  project_id = azuredevops_project.example.id
  name       = "Example Git Repository"
  initialization {
    init_type = "Clean"
  }
}

resource "azuredevops_git_repository_file" "example" {
  repository_id       = azuredevops_git_repository.example.id
  file                = ".gitignore"
  content             = "**/*.tfstate"
  branch              = "refs/heads/master"
  commit_message      = "First commit"
  overwrite_on_create = false
}

Argument Reference

The following arguments are supported:

Import

Repository files can be imported using a combination of the repository ID and file, e.g.

terraform import azuredevops_git_repository_file.example 00000000-0000-0000-0000-000000000000/.gitignore

To import a file from a branch other than master, append : and the branch name, e.g.

terraform import azuredevops_git_repository_file.example 00000000-0000-0000-0000-000000000000/.gitignore:refs/heads/master