azuredevops.Git
Explore with Pulumi AI
Import
Azure DevOps Repositories can be imported using the repo name or by the repo Guid e.g.
$ pulumi import azuredevops:index/git:Git example projectName/repoName
or
$ pulumi import azuredevops:index/git:Git example projectName/00000000-0000-0000-0000-000000000000
Create Git Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Git(name: string, args: GitArgs, opts?: CustomResourceOptions);@overload
def Git(resource_name: str,
        args: GitArgs,
        opts: Optional[ResourceOptions] = None)
@overload
def Git(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        initialization: Optional[GitInitializationArgs] = None,
        project_id: Optional[str] = None,
        default_branch: Optional[str] = None,
        disabled: Optional[bool] = None,
        name: Optional[str] = None,
        parent_repository_id: Optional[str] = None)func NewGit(ctx *Context, name string, args GitArgs, opts ...ResourceOption) (*Git, error)public Git(string name, GitArgs args, CustomResourceOptions? opts = null)type: azuredevops:Git
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
- args GitArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control 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.
- name String
- The unique name of the resource.
- args GitArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var gitResource = new AzureDevOps.Git("gitResource", new()
{
    Initialization = new AzureDevOps.Inputs.GitInitializationArgs
    {
        InitType = "string",
        Password = "string",
        ServiceConnectionId = "string",
        SourceType = "string",
        SourceUrl = "string",
        Username = "string",
    },
    ProjectId = "string",
    DefaultBranch = "string",
    Disabled = false,
    Name = "string",
    ParentRepositoryId = "string",
});
example, err := azuredevops.NewGit(ctx, "gitResource", &azuredevops.GitArgs{
	Initialization: &azuredevops.GitInitializationArgs{
		InitType:            pulumi.String("string"),
		Password:            pulumi.String("string"),
		ServiceConnectionId: pulumi.String("string"),
		SourceType:          pulumi.String("string"),
		SourceUrl:           pulumi.String("string"),
		Username:            pulumi.String("string"),
	},
	ProjectId:          pulumi.String("string"),
	DefaultBranch:      pulumi.String("string"),
	Disabled:           pulumi.Bool(false),
	Name:               pulumi.String("string"),
	ParentRepositoryId: pulumi.String("string"),
})
var gitResource = new Git("gitResource", GitArgs.builder()
    .initialization(GitInitializationArgs.builder()
        .initType("string")
        .password("string")
        .serviceConnectionId("string")
        .sourceType("string")
        .sourceUrl("string")
        .username("string")
        .build())
    .projectId("string")
    .defaultBranch("string")
    .disabled(false)
    .name("string")
    .parentRepositoryId("string")
    .build());
git_resource = azuredevops.Git("gitResource",
    initialization={
        "init_type": "string",
        "password": "string",
        "service_connection_id": "string",
        "source_type": "string",
        "source_url": "string",
        "username": "string",
    },
    project_id="string",
    default_branch="string",
    disabled=False,
    name="string",
    parent_repository_id="string")
const gitResource = new azuredevops.Git("gitResource", {
    initialization: {
        initType: "string",
        password: "string",
        serviceConnectionId: "string",
        sourceType: "string",
        sourceUrl: "string",
        username: "string",
    },
    projectId: "string",
    defaultBranch: "string",
    disabled: false,
    name: "string",
    parentRepositoryId: "string",
});
type: azuredevops:Git
properties:
    defaultBranch: string
    disabled: false
    initialization:
        initType: string
        password: string
        serviceConnectionId: string
        sourceType: string
        sourceUrl: string
        username: string
    name: string
    parentRepositoryId: string
    projectId: string
Git Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Git resource accepts the following input properties:
- Initialization
Pulumi.Azure Dev Ops. Inputs. Git Initialization 
- A initializationblock as documented below.
- ProjectId string
- The project ID or project name.
- DefaultBranch string
- The ref of the default branch. Will be used as the branch name for initialized repositories.
- Disabled bool
- The ability to disable or enable the repository. Defaults to false.
- Name string
- The name of the git repository.
- ParentRepository stringId 
- The ID of a Git project from which a fork is to be created.
- Initialization
GitInitialization Args 
- A initializationblock as documented below.
- ProjectId string
- The project ID or project name.
- DefaultBranch string
- The ref of the default branch. Will be used as the branch name for initialized repositories.
- Disabled bool
- The ability to disable or enable the repository. Defaults to false.
- Name string
- The name of the git repository.
- ParentRepository stringId 
- The ID of a Git project from which a fork is to be created.
- initialization
GitInitialization 
- A initializationblock as documented below.
- projectId String
- The project ID or project name.
- defaultBranch String
- The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled Boolean
- The ability to disable or enable the repository. Defaults to false.
- name String
- The name of the git repository.
- parentRepository StringId 
- The ID of a Git project from which a fork is to be created.
- initialization
GitInitialization 
- A initializationblock as documented below.
- projectId string
- The project ID or project name.
- defaultBranch string
- The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled boolean
- The ability to disable or enable the repository. Defaults to false.
- name string
- The name of the git repository.
- parentRepository stringId 
- The ID of a Git project from which a fork is to be created.
- initialization
GitInitialization Args 
- A initializationblock as documented below.
- project_id str
- The project ID or project name.
- default_branch str
- The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled bool
- The ability to disable or enable the repository. Defaults to false.
- name str
- The name of the git repository.
- parent_repository_ strid 
- The ID of a Git project from which a fork is to be created.
- initialization Property Map
- A initializationblock as documented below.
- projectId String
- The project ID or project name.
- defaultBranch String
- The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled Boolean
- The ability to disable or enable the repository. Defaults to false.
- name String
- The name of the git repository.
- parentRepository StringId 
- The ID of a Git project from which a fork is to be created.
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 Integer
- 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 int
- 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.
- 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.
Look up 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@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        default_branch: Optional[str] = None,
        disabled: Optional[bool] = None,
        initialization: Optional[GitInitializationArgs] = None,
        is_fork: Optional[bool] = None,
        name: Optional[str] = None,
        parent_repository_id: Optional[str] = None,
        project_id: Optional[str] = None,
        remote_url: Optional[str] = None,
        size: Optional[int] = None,
        ssh_url: Optional[str] = None,
        url: Optional[str] = None,
        web_url: Optional[str] = None) -> Gitfunc 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)public static Git get(String name, Output<String> id, GitState state, CustomResourceOptions options)resources:  _:    type: azuredevops:Git    get:      id: ${id}- 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.
- 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.
- DefaultBranch string
- The ref of the default branch. Will be used as the branch name for initialized repositories.
- Disabled bool
- The ability to disable or enable the repository. Defaults to false.
- Initialization
Pulumi.Azure Dev Ops. Inputs. Git Initialization 
- A initializationblock as documented below.
- IsFork bool
- True if the repository was created as a fork.
- Name string
- The name of the git repository.
- ParentRepository stringId 
- The ID of a Git project from which a fork is to be created.
- 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. Will be used as the branch name for initialized repositories.
- Disabled bool
- The ability to disable or enable the repository. Defaults to false.
- Initialization
GitInitialization Args 
- A initializationblock as documented below.
- IsFork bool
- True if the repository was created as a fork.
- Name string
- The name of the git repository.
- ParentRepository stringId 
- The ID of a Git project from which a fork is to be created.
- 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. Will be used as the branch name for initialized repositories.
- disabled Boolean
- The ability to disable or enable the repository. Defaults to false.
- initialization
GitInitialization 
- A initializationblock as documented below.
- isFork Boolean
- True if the repository was created as a fork.
- name String
- The name of the git repository.
- parentRepository StringId 
- The ID of a Git project from which a fork is to be created.
- projectId String
- The project ID or project name.
- remoteUrl String
- Git HTTPS URL of the repository
- size Integer
- 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. Will be used as the branch name for initialized repositories.
- disabled boolean
- The ability to disable or enable the repository. Defaults to false.
- initialization
GitInitialization 
- A initializationblock as documented below.
- isFork boolean
- True if the repository was created as a fork.
- name string
- The name of the git repository.
- parentRepository stringId 
- The ID of a Git project from which a fork is to be created.
- 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. Will be used as the branch name for initialized repositories.
- disabled bool
- The ability to disable or enable the repository. Defaults to false.
- initialization
GitInitialization Args 
- A 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 
- The ID of a Git project from which a fork is to be created.
- project_id str
- The project ID or project name.
- remote_url str
- Git HTTPS URL of the repository
- size int
- 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.
- defaultBranch String
- The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled Boolean
- The ability to disable or enable the repository. Defaults to false.
- initialization Property Map
- A initializationblock as documented below.
- isFork Boolean
- True if the repository was created as a fork.
- name String
- The name of the git repository.
- parentRepository StringId 
- The ID of a Git project from which a fork is to be created.
- 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.
Supporting Types
GitInitialization, GitInitializationArgs    
- InitType string
- The type of repository to create. Valid values: Uninitialized,CleanorImport.
- Password string
- The password used to authenticate to a private repository for import initialization. Conflicts with - service_connection_id.- ~>Note At least - service_connection_idor- username/passwordneeds to be set to import private repository.
- ServiceConnection stringId 
- The ID of service connection used to authenticate to a private repository for import initialization. Conflicts with usernameandpassword.
- SourceType string
- Type of the source repository. Used if the init_typeisImport. Valid values:Git.
- SourceUrl string
- The URL of the source repository. Used if the init_typeisImport.
- Username string
- The username used to authenticate to a private repository for import initialization. Conflicts with service_connection_id.
- InitType string
- The type of repository to create. Valid values: Uninitialized,CleanorImport.
- Password string
- The password used to authenticate to a private repository for import initialization. Conflicts with - service_connection_id.- ~>Note At least - service_connection_idor- username/passwordneeds to be set to import private repository.
- ServiceConnection stringId 
- The ID of service connection used to authenticate to a private repository for import initialization. Conflicts with usernameandpassword.
- SourceType string
- Type of the source repository. Used if the init_typeisImport. Valid values:Git.
- SourceUrl string
- The URL of the source repository. Used if the init_typeisImport.
- Username string
- The username used to authenticate to a private repository for import initialization. Conflicts with service_connection_id.
- initType String
- The type of repository to create. Valid values: Uninitialized,CleanorImport.
- password String
- The password used to authenticate to a private repository for import initialization. Conflicts with - service_connection_id.- ~>Note At least - service_connection_idor- username/passwordneeds to be set to import private repository.
- serviceConnection StringId 
- The ID of service connection used to authenticate to a private repository for import initialization. Conflicts with usernameandpassword.
- sourceType String
- Type of the source repository. Used if the init_typeisImport. Valid values:Git.
- sourceUrl String
- The URL of the source repository. Used if the init_typeisImport.
- username String
- The username used to authenticate to a private repository for import initialization. Conflicts with service_connection_id.
- initType string
- The type of repository to create. Valid values: Uninitialized,CleanorImport.
- password string
- The password used to authenticate to a private repository for import initialization. Conflicts with - service_connection_id.- ~>Note At least - service_connection_idor- username/passwordneeds to be set to import private repository.
- serviceConnection stringId 
- The ID of service connection used to authenticate to a private repository for import initialization. Conflicts with usernameandpassword.
- sourceType string
- Type of the source repository. Used if the init_typeisImport. Valid values:Git.
- sourceUrl string
- The URL of the source repository. Used if the init_typeisImport.
- username string
- The username used to authenticate to a private repository for import initialization. Conflicts with service_connection_id.
- init_type str
- The type of repository to create. Valid values: Uninitialized,CleanorImport.
- password str
- The password used to authenticate to a private repository for import initialization. Conflicts with - service_connection_id.- ~>Note At least - service_connection_idor- username/passwordneeds to be set to import private repository.
- service_connection_ strid 
- The ID of service connection used to authenticate to a private repository for import initialization. Conflicts with usernameandpassword.
- source_type str
- Type of the source repository. Used if the init_typeisImport. Valid values:Git.
- source_url str
- The URL of the source repository. Used if the init_typeisImport.
- username str
- The username used to authenticate to a private repository for import initialization. Conflicts with service_connection_id.
- initType String
- The type of repository to create. Valid values: Uninitialized,CleanorImport.
- password String
- The password used to authenticate to a private repository for import initialization. Conflicts with - service_connection_id.- ~>Note At least - service_connection_idor- username/passwordneeds to be set to import private repository.
- serviceConnection StringId 
- The ID of service connection used to authenticate to a private repository for import initialization. Conflicts with usernameandpassword.
- sourceType String
- Type of the source repository. Used if the init_typeisImport. Valid values:Git.
- sourceUrl String
- The URL of the source repository. Used if the init_typeisImport.
- username String
- The username used to authenticate to a private repository for import initialization. Conflicts with service_connection_id.
Package Details
- Repository
- Azure DevOps pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azuredevopsTerraform Provider.