Git

Manages a git repository within Azure DevOps.

Example Usage

Create Git repository

using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

class MyStack : Stack
{
    public MyStack()
    {
        var project = new AzureDevOps.Core.Project("project", new AzureDevOps.Core.ProjectArgs
        {
            ProjectName = "Sample Project",
            Visibility = "private",
            VersionControl = "Git",
            WorkItemTemplate = "Agile",
        });
        var repo = new AzureDevOps.Repository.Git("repo", new AzureDevOps.Repository.GitArgs
        {
            ProjectId = project.Id,
            Initialization = new AzureDevOps.Repository.Inputs.GitInitializationArgs
            {
                InitType = "Clean",
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Core"
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Repository"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        project, err := Core.NewProject(ctx, "project", &Core.ProjectArgs{
            ProjectName:      pulumi.String("Sample Project"),
            Visibility:       pulumi.String("private"),
            VersionControl:   pulumi.String("Git"),
            WorkItemTemplate: pulumi.String("Agile"),
        })
        if err != nil {
            return err
        }
        repo, err := Repository.NewGit(ctx, "repo", &Repository.GitArgs{
            ProjectId: project.ID(),
            Initialization: &Repository.GitInitializationArgs{
                InitType: pulumi.String("Clean"),
            },
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azuredevops as azuredevops

project = azuredevops.core.Project("project",
    project_name="Sample Project",
    visibility="private",
    version_control="Git",
    work_item_template="Agile")
repo = azuredevops.repository.Git("repo",
    project_id=project.id,
    initialization={
        "initType": "Clean",
    })
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const project = new azuredevops.Core.Project("project", {
    projectName: "Sample Project",
    visibility: "private",
    versionControl: "Git",
    workItemTemplate: "Agile",
});
const repo = new azuredevops.Repository.Git("repo", {
    projectId: project.id,
    initialization: {
        initType: "Clean",
    },
});

Create a Git Resource

new Git(name: string, args: GitArgs, opts?: CustomResourceOptions);
def Git(resource_name, opts=None, default_branch=None, initialization=None, name=None, parent_repository_id=None, project_id=None, __props__=None);
func NewGit(ctx *Context, name string, args GitArgs, opts ...ResourceOption) (*Git, error)
public Git(string name, GitArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args GitArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args GitArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GitArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Git Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Git resource accepts the following input properties:

ProjectId string

The project ID or project name.

DefaultBranch string

The ref of the default branch.

Initialization Pulumi.AzureDevOps.Repository.Inputs.GitInitializationArgs

An initialization block as documented below.

Name string

The name of the git repository.

ParentRepositoryId string
ProjectId string

The project ID or project name.

DefaultBranch string

The ref of the default branch.

Initialization GitInitialization

An initialization block as documented below.

Name string

The name of the git repository.

ParentRepositoryId string
projectId string

The project ID or project name.

defaultBranch string

The ref of the default branch.

initialization GitInitialization

An initialization block as documented below.

name string

The name of the git repository.

parentRepositoryId string
project_id str

The project ID or project name.

default_branch str

The ref of the default branch.

initialization Dict[GitInitialization]

An initialization block as documented below.

name str

The name of the git repository.

parent_repository_id str

Outputs

All input properties are implicitly available as output properties. Additionally, the Git resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
IsFork bool

True if the repository was created as a fork.

RemoteUrl string

Git HTTPS URL of the repository

Size int

Size in bytes.

SshUrl string

Git SSH URL of the repository.

Url string

REST API URL of the repository.

WebUrl string

Web link to the repository.

Id string
The provider-assigned unique ID for this managed resource.
IsFork bool

True if the repository was created as a fork.

RemoteUrl string

Git HTTPS URL of the repository

Size int

Size in bytes.

SshUrl string

Git SSH URL of the repository.

Url string

REST API URL of the repository.

WebUrl string

Web link to the repository.

id string
The provider-assigned unique ID for this managed resource.
isFork boolean

True if the repository was created as a fork.

remoteUrl string

Git HTTPS URL of the repository

size number

Size in bytes.

sshUrl string

Git SSH URL of the repository.

url string

REST API URL of the repository.

webUrl string

Web link to the repository.

id str
The provider-assigned unique ID for this managed resource.
is_fork bool

True if the repository was created as a fork.

remote_url str

Git HTTPS URL of the repository

size float

Size in bytes.

ssh_url str

Git SSH URL of the repository.

url str

REST API URL of the repository.

web_url str

Web link to the repository.

Look up an Existing Git Resource

Get an existing Git resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: GitState, opts?: CustomResourceOptions): Git
static get(resource_name, id, opts=None, default_branch=None, initialization=None, is_fork=None, name=None, parent_repository_id=None, project_id=None, remote_url=None, size=None, ssh_url=None, url=None, web_url=None, __props__=None);
func GetGit(ctx *Context, name string, id IDInput, state *GitState, opts ...ResourceOption) (*Git, error)
public static Git Get(string name, Input<string> id, GitState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

DefaultBranch string

The ref of the default branch.

Initialization Pulumi.AzureDevOps.Repository.Inputs.GitInitializationArgs

An initialization block as documented below.

IsFork bool

True if the repository was created as a fork.

Name string

The name of the git repository.

ParentRepositoryId string
ProjectId string

The project ID or project name.

RemoteUrl string

Git HTTPS URL of the repository

Size int

Size in bytes.

SshUrl string

Git SSH URL of the repository.

Url string

REST API URL of the repository.

WebUrl string

Web link to the repository.

DefaultBranch string

The ref of the default branch.

Initialization GitInitialization

An initialization block as documented below.

IsFork bool

True if the repository was created as a fork.

Name string

The name of the git repository.

ParentRepositoryId string
ProjectId string

The project ID or project name.

RemoteUrl string

Git HTTPS URL of the repository

Size int

Size in bytes.

SshUrl string

Git SSH URL of the repository.

Url string

REST API URL of the repository.

WebUrl string

Web link to the repository.

defaultBranch string

The ref of the default branch.

initialization GitInitialization

An initialization block as documented below.

isFork boolean

True if the repository was created as a fork.

name string

The name of the git repository.

parentRepositoryId string
projectId string

The project ID or project name.

remoteUrl string

Git HTTPS URL of the repository

size number

Size in bytes.

sshUrl string

Git SSH URL of the repository.

url string

REST API URL of the repository.

webUrl string

Web link to the repository.

default_branch str

The ref of the default branch.

initialization Dict[GitInitialization]

An initialization block as documented below.

is_fork bool

True if the repository was created as a fork.

name str

The name of the git repository.

parent_repository_id str
project_id str

The project ID or project name.

remote_url str

Git HTTPS URL of the repository

size float

Size in bytes.

ssh_url str

Git SSH URL of the repository.

url str

REST API URL of the repository.

web_url str

Web link to the repository.

Supporting Types

GitInitialization

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

InitType string

The type of repository to create. Valid values: Uninitialized, Clean, or Import. Defaults to Uninitialized.

SourceType string

Type type of the source repository. Used if the init_type is Import.

SourceUrl string

The URL of the source repository. Used if the init_type is Import.

InitType string

The type of repository to create. Valid values: Uninitialized, Clean, or Import. Defaults to Uninitialized.

SourceType string

Type type of the source repository. Used if the init_type is Import.

SourceUrl string

The URL of the source repository. Used if the init_type is Import.

initType string

The type of repository to create. Valid values: Uninitialized, Clean, or Import. Defaults to Uninitialized.

sourceType string

Type type of the source repository. Used if the init_type is Import.

sourceUrl string

The URL of the source repository. Used if the init_type is Import.

initType str

The type of repository to create. Valid values: Uninitialized, Clean, or Import. Defaults to Uninitialized.

sourceType str

Type type of the source repository. Used if the init_type is Import.

sourceUrl str

The URL of the source repository. Used if the init_type is Import.

Package Details

Repository
https://github.com/pulumi/pulumi-azuredevops
License
Apache-2.0
Notes
This Pulumi package is based on the azuredevops Terraform Provider.