---
schema_version: "1"
id: e66529e985b42fed00977a17b6e3a83a841c823b689e17f86785909d9cd646eb
title: SourceCodeRepositoryBranch
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_sourcecoderepositorybranch.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_sourcecoderepositorybranch.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9d012bbcd102207e43633890bad00e3ee87cbd07df6c3c582378e649af21e459
description: Represents a specific branch within a source control repository, such as a feature branch for a work item or a release branch for a pipeline stage. Work Item and Pipeline Stage records refer to this object. This object is available in API version 66.0 and later.
---
# SourceCodeRepositoryBranch

Represents a specific branch within a source control repository, such as a feature branch for a work item or a release branch for a pipeline stage. Work Item and Pipeline Stage records refer to this object. This object is available in API version 66.0 and later.

## Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

## Fields

| Field | Details |
| --- | --- |
| IgnoreRules | 
Type

textarea

Properties

Create, Nillable, Update

Description

Serialized JSON representation of the preprocessed contents of the .forceignore file on the branch.



 |
| LastReferencedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp when the current user last accessed this record indirectly, for example, through a list view or related record.



 |
| LastViewedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp when the current user last viewed this record or list view. If this value is null, and LastReferenceDate is not null, the user accessed this record or list view indirectly.



 |
| Name | 

Type

string

Properties

Create, Filter, Group, idLookup, Sort, Update

Description

The name of the branch as it exists in the source control provider. For example, feature/WI-000001.



 |
| ParentRemoteReference | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The unique identifier of the parent branch from which this branch was originally created. In GitHub, this ID is called a SHA. DevOps Center uses this ID to recreate the branch if necessary.



 |
| RemoteReference | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The unique identifier representing the latest synced state of this branch in the source control provider. In GitHub, this ID is called the HEAD SHA.



 |
| RemoteReferenceDate | 

Type

dateTime

Properties

Create, Filter, Nillable, Sort, Update

Description

The last date and time when the branch identified by Remote Reference field was last updated or synced.



 |
| SourceCodeRepositoryId | 

Type

reference

Properties

Create, Filter, Group, Sort

Description

The ID of the parent SourceCodeRepository record in which the branch lives.

This field is a relationship field.

Relationship Name

SourceCodeRepository

Relationship Type

Master-detail

Refers To

SourceCodeRepository (the master object)



 |
| Status | 

Type

picklist

Properties

Create, Filter, Group, Nillable, Restricted picklist, Sort, Update

Description

Indicates the current health or sync state of the branch.

Possible values are:

- DEPLOYMENT\_ERROR—A deployment to the environment associated with this branch failed.
- MERGE\_CONFLICT—A conflict exists between this branch and its target promotion branch.





 |

## Usage

Use this object to track the state of the feature branch every time a developer starts a new work item. Similarly, each stage in a pipeline is mapped to a specific branch defined in this object. It stores remote references (commit SHAs) and tracks sync issues like merge conflicts.

## Associated Objects

This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version and later.

[SourceCodeRepositoryBranchChangeEvent](https://developer.salesforce.com/docs/atlas.en-us.264.0.object_reference.meta/object_reference/sforce_api_associated_objects_change_event.htm)

Change events are available for the object.

[SourceCodeRepositoryBranchFeed](https://developer.salesforce.com/docs/atlas.en-us.264.0.object_reference.meta/object_reference/sforce_api_associated_objects_feed.htm)

Feed tracking is available for the object.

[SourceCodeRepositoryBranchHistory](https://developer.salesforce.com/docs/atlas.en-us.264.0.object_reference.meta/object_reference/sforce_api_associated_objects_history.htm)

History is available for tracked fields of the object.

[SourceCodeRepositoryBranchOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.264.0.object_reference.meta/object_reference/sforce_api_associated_objects_ownersharingrule.htm)

Sharing rules are available for the object.

[SourceCodeRepositoryBranchShare](https://developer.salesforce.com/docs/atlas.en-us.264.0.object_reference.meta/object_reference/sforce_api_associated_objects_share.htm)

Sharing is available for the object.

#### See Also

- [SourceCodeRepository](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_sourcecoderepository.htm "Represents a specific version control repository hosted by a provider, such as GitHub, that stores the metadata and configuration data for a DevOps Center project. Multiple projects can reference the same repository. This object is available in API version 66.0 and later.")
- [DevopsPipelineStage](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_devopspipelinestage.htm "Represents a connection between a pipeline, an environment, and the source control branch used for that stage. The collection of all pipeline stages in a project make up the Lifecycle Center pipeline. This object is available in API version 66.0 and later.")
- [WorkItem](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_workitem.htm "Represents a logical unit of work, such as a user story, task, or bug, used to track the progress of metadata and configuration data changes within a Lifecycle Center project. A work item moves through multiple development lifecycle stages until all development work is complete and the work item is part of the release pipeline. This object is available in API version 67.0 and later.")
- [DevopsPipelnStgPromWkItem](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_devopspipelnstgprom.htm "Represents a stage promotion in Lifecycle Center. Stage promotion moves one or more work items to the next stage in the pipeline. This object is available in API version 66.0 and later.")