summaryrefslogtreecommitdiff
path: root/website/docs/d/git_repository.html.markdown
blob: 6ce71bad0b81beb9c9b84ac64692ecf2a5bf58e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
layout: "azuredevops"
page_title: "AzureDevops: azuredevops_git_repository"
description: |-
  Use this data source to access information about an existing Git Repository within Azure DevOps.
---

# Data Source: azuredevops_git_repository

Use this data source to access information about a **single** (existing) Git Repository within Azure DevOps.
To read information about **multiple** Git Repositories use the data source [`azuredevops_git_repositories`](data_git_repositories.html)

## Example Usage

```hcl
data "azuredevops_project" "example" {
  name = "Example Project"
}

# Load a specific Git repository by name
data "azuredevops_git_repository" "example-single-repo" {
  project_id = data.azuredevops_project.example.id
  name       = "Example Repository"
}
```

## Argument Reference

The following arguments are supported:

- `project_id` - (Required) ID of project to list Git repositories
- `name` - (Required) Name of the Git repository to retrieve

## Attributes Reference

The following attributes are exported:

- `id` - Git repository identifier.
- `name` - Git repository name.
- `url` - Details REST API endpoint for the Git Repository.
- `ssh_url` - SSH Url to clone the Git repository
- `web_url` - Url of the Git repository web view
- `remote_url` - HTTPS Url to clone the Git repository
- `project_id` - Project identifier to which the Git repository belongs.
- `size` - Compressed size (bytes) of the repository.
- `default_branch` - The ref of the default branch.

## Relevant Links

- [Azure DevOps Service REST API 6.0 - Git API](https://docs.microsoft.com/en-us/rest/api/azure/devops/git/?view=azure-devops-rest-6.0)