Git
Manages a git repository within Azure DevOps.
Relevant Links
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);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:
- Project
Id string The project ID or project name.
- Default
Branch string The ref of the default branch.
- Initialization
Pulumi.
Azure Dev Ops. Repository. Inputs. Git Initialization Args An
initializationblock as documented below.- Name string
The name of the git repository.
- Parent
Repository stringId
- Project
Id string The project ID or project name.
- Default
Branch string The ref of the default branch.
- Initialization
Git
Initialization An
initializationblock as documented below.- Name string
The name of the git repository.
- Parent
Repository stringId
- project
Id string The project ID or project name.
- default
Branch string The ref of the default branch.
- initialization
Git
Initialization An
initializationblock as documented below.- name string
The name of the git repository.
- parent
Repository stringId
- project_
id str The project ID or project name.
- default_
branch str The ref of the default branch.
- initialization
Dict[Git
Initialization] An
initializationblock as documented below.- name str
The name of the git repository.
- parent_
repository_ strid
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.
- Is
Fork bool True if the repository was created as a fork.
- Remote
Url string Git HTTPS URL of the repository
- Size int
Size in bytes.
- Ssh
Url string Git SSH URL of the repository.
- Url string
REST API URL of the repository.
- Web
Url string Web link to the repository.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Fork bool True if the repository was created as a fork.
- Remote
Url string Git HTTPS URL of the repository
- Size int
Size in bytes.
- Ssh
Url string Git SSH URL of the repository.
- Url string
REST API URL of the repository.
- Web
Url string Web link to the repository.
- id string
- The provider-assigned unique ID for this managed resource.
- is
Fork boolean True if the repository was created as a fork.
- remote
Url string Git HTTPS URL of the repository
- size number
Size in bytes.
- ssh
Url string Git SSH URL of the repository.
- url string
REST API URL of the repository.
- web
Url 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): Gitstatic 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);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:
- Default
Branch string The ref of the default branch.
- Initialization
Pulumi.
Azure Dev Ops. Repository. Inputs. Git Initialization Args An
initializationblock as documented below.- Is
Fork bool True if the repository was created as a fork.
- Name string
The name of the git repository.
- Parent
Repository stringId - Project
Id string The project ID or project name.
- Remote
Url string Git HTTPS URL of the repository
- Size int
Size in bytes.
- Ssh
Url string Git SSH URL of the repository.
- Url string
REST API URL of the repository.
- Web
Url string Web link to the repository.
- Default
Branch string The ref of the default branch.
- Initialization
Git
Initialization An
initializationblock as documented below.- Is
Fork bool True if the repository was created as a fork.
- Name string
The name of the git repository.
- Parent
Repository stringId - Project
Id string The project ID or project name.
- Remote
Url string Git HTTPS URL of the repository
- Size int
Size in bytes.
- Ssh
Url string Git SSH URL of the repository.
- Url string
REST API URL of the repository.
- Web
Url string Web link to the repository.
- default
Branch string The ref of the default branch.
- initialization
Git
Initialization An
initializationblock as documented below.- is
Fork boolean True if the repository was created as a fork.
- name string
The name of the git repository.
- parent
Repository stringId - project
Id string The project ID or project name.
- remote
Url string Git HTTPS URL of the repository
- size number
Size in bytes.
- ssh
Url string Git SSH URL of the repository.
- url string
REST API URL of the repository.
- web
Url string Web link to the repository.
- default_
branch str The ref of the default branch.
- initialization
Dict[Git
Initialization] An
initializationblock 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_ strid - 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
Package Details
- Repository
- https://github.com/pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuredevopsTerraform Provider.