GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi
gitlab.getBranch
Explore with Pulumi AI
The gitlab.Branch data source allows details of a repository branch to be retrieved by its name and project.
Upstream API: GitLab REST API docs
Using getBranch
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getBranch(args: GetBranchArgs, opts?: InvokeOptions): Promise<GetBranchResult>
function getBranchOutput(args: GetBranchOutputArgs, opts?: InvokeOptions): Output<GetBranchResult>def get_branch(name: Optional[str] = None,
               project: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetBranchResult
def get_branch_output(name: Optional[pulumi.Input[str]] = None,
               project: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetBranchResult]func LookupBranch(ctx *Context, args *LookupBranchArgs, opts ...InvokeOption) (*LookupBranchResult, error)
func LookupBranchOutput(ctx *Context, args *LookupBranchOutputArgs, opts ...InvokeOption) LookupBranchResultOutput> Note: This function is named LookupBranch in the Go SDK.
public static class GetBranch 
{
    public static Task<GetBranchResult> InvokeAsync(GetBranchArgs args, InvokeOptions? opts = null)
    public static Output<GetBranchResult> Invoke(GetBranchInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetBranchResult> getBranch(GetBranchArgs args, InvokeOptions options)
public static Output<GetBranchResult> getBranch(GetBranchArgs args, InvokeOptions options)
fn::invoke:
  function: gitlab:index/getBranch:getBranch
  arguments:
    # arguments dictionaryThe following arguments are supported:
getBranch Result
The following output properties are available:
- Can
Push bool - Bool, true if you can push to the branch.
 - Commits
List<Pulumi.
Git Lab. Outputs. Get Branch Commit>  - The commit associated with the branch ref.
 - Default bool
 - Bool, true if branch is the default branch for the project.
 - Developer
Can boolMerge  - Bool, true if developer level access allows to merge branch.
 - Developer
Can boolPush  - Bool, true if developer level access allows git push.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Merged bool
 - Bool, true if the branch has been merged into it's parent.
 - Name string
 - The name of the branch.
 - Project string
 - The full path or id of the project.
 - Protected bool
 - Bool, true if branch has branch protection.
 - Web
Url string - The url of the created branch (https.)
 
- Can
Push bool - Bool, true if you can push to the branch.
 - Commits
[]Get
Branch Commit  - The commit associated with the branch ref.
 - Default bool
 - Bool, true if branch is the default branch for the project.
 - Developer
Can boolMerge  - Bool, true if developer level access allows to merge branch.
 - Developer
Can boolPush  - Bool, true if developer level access allows git push.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Merged bool
 - Bool, true if the branch has been merged into it's parent.
 - Name string
 - The name of the branch.
 - Project string
 - The full path or id of the project.
 - Protected bool
 - Bool, true if branch has branch protection.
 - Web
Url string - The url of the created branch (https.)
 
- can
Push Boolean - Bool, true if you can push to the branch.
 - commits
List<Get
Branch Commit>  - The commit associated with the branch ref.
 - default_ Boolean
 - Bool, true if branch is the default branch for the project.
 - developer
Can BooleanMerge  - Bool, true if developer level access allows to merge branch.
 - developer
Can BooleanPush  - Bool, true if developer level access allows git push.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - merged Boolean
 - Bool, true if the branch has been merged into it's parent.
 - name String
 - The name of the branch.
 - project String
 - The full path or id of the project.
 - protected_ Boolean
 - Bool, true if branch has branch protection.
 - web
Url String - The url of the created branch (https.)
 
- can
Push boolean - Bool, true if you can push to the branch.
 - commits
Get
Branch Commit[]  - The commit associated with the branch ref.
 - default boolean
 - Bool, true if branch is the default branch for the project.
 - developer
Can booleanMerge  - Bool, true if developer level access allows to merge branch.
 - developer
Can booleanPush  - Bool, true if developer level access allows git push.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - merged boolean
 - Bool, true if the branch has been merged into it's parent.
 - name string
 - The name of the branch.
 - project string
 - The full path or id of the project.
 - protected boolean
 - Bool, true if branch has branch protection.
 - web
Url string - The url of the created branch (https.)
 
- can_
push bool - Bool, true if you can push to the branch.
 - commits
Sequence[Get
Branch Commit]  - The commit associated with the branch ref.
 - default bool
 - Bool, true if branch is the default branch for the project.
 - developer_
can_ boolmerge  - Bool, true if developer level access allows to merge branch.
 - developer_
can_ boolpush  - Bool, true if developer level access allows git push.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - merged bool
 - Bool, true if the branch has been merged into it's parent.
 - name str
 - The name of the branch.
 - project str
 - The full path or id of the project.
 - protected bool
 - Bool, true if branch has branch protection.
 - web_
url str - The url of the created branch (https.)
 
- can
Push Boolean - Bool, true if you can push to the branch.
 - commits List<Property Map>
 - The commit associated with the branch ref.
 - default Boolean
 - Bool, true if branch is the default branch for the project.
 - developer
Can BooleanMerge  - Bool, true if developer level access allows to merge branch.
 - developer
Can BooleanPush  - Bool, true if developer level access allows git push.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - merged Boolean
 - Bool, true if the branch has been merged into it's parent.
 - name String
 - The name of the branch.
 - project String
 - The full path or id of the project.
 - protected Boolean
 - Bool, true if branch has branch protection.
 - web
Url String - The url of the created branch (https.)
 
Supporting Types
GetBranchCommit  
- string
 - The email of the author.
 - string
 - The name of the author.
 - string
 - The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
 - Committed
Date string - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
 - Committer
Email string - The email of the user that committed.
 - Committer
Name string - The name of the user that committed.
 - Id string
 - The unique id assigned to the commit by Gitlab.
 - Message string
 - The commit message
 - Parent
Ids List<string> - The id of the parents of the commit
 - Short
Id string - The short id assigned to the commit by Gitlab.
 - Title string
 - The title of the commit
 
- string
 - The email of the author.
 - string
 - The name of the author.
 - string
 - The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
 - Committed
Date string - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
 - Committer
Email string - The email of the user that committed.
 - Committer
Name string - The name of the user that committed.
 - Id string
 - The unique id assigned to the commit by Gitlab.
 - Message string
 - The commit message
 - Parent
Ids []string - The id of the parents of the commit
 - Short
Id string - The short id assigned to the commit by Gitlab.
 - Title string
 - The title of the commit
 
- String
 - The email of the author.
 - String
 - The name of the author.
 - String
 - The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
 - committed
Date String - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
 - committer
Email String - The email of the user that committed.
 - committer
Name String - The name of the user that committed.
 - id String
 - The unique id assigned to the commit by Gitlab.
 - message String
 - The commit message
 - parent
Ids List<String> - The id of the parents of the commit
 - short
Id String - The short id assigned to the commit by Gitlab.
 - title String
 - The title of the commit
 
- string
 - The email of the author.
 - string
 - The name of the author.
 - string
 - The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
 - committed
Date string - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
 - committer
Email string - The email of the user that committed.
 - committer
Name string - The name of the user that committed.
 - id string
 - The unique id assigned to the commit by Gitlab.
 - message string
 - The commit message
 - parent
Ids string[] - The id of the parents of the commit
 - short
Id string - The short id assigned to the commit by Gitlab.
 - title string
 - The title of the commit
 
- str
 - The email of the author.
 - str
 - The name of the author.
 - str
 - The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
 - committed_
date str - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
 - committer_
email str - The email of the user that committed.
 - committer_
name str - The name of the user that committed.
 - id str
 - The unique id assigned to the commit by Gitlab.
 - message str
 - The commit message
 - parent_
ids Sequence[str] - The id of the parents of the commit
 - short_
id str - The short id assigned to the commit by Gitlab.
 - title str
 - The title of the commit
 
- String
 - The email of the author.
 - String
 - The name of the author.
 - String
 - The date which the commit was authored (format: yyyy-MM-ddTHH:mm:ssZ).
 - committed
Date String - The date at which the commit was pushed (format: yyyy-MM-ddTHH:mm:ssZ).
 - committer
Email String - The email of the user that committed.
 - committer
Name String - The name of the user that committed.
 - id String
 - The unique id assigned to the commit by Gitlab.
 - message String
 - The commit message
 - parent
Ids List<String> - The id of the parents of the commit
 - short
Id String - The short id assigned to the commit by Gitlab.
 - title String
 - The title of the commit
 
Package Details
- Repository
 - GitLab pulumi/pulumi-gitlab
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
gitlabTerraform Provider.