---
schema_version: "1"
id: bc5cc00203659886a21b719352f030c46b2732d0dd83e4a1f62861ded7374007
title: SourceCodeRepository
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_sourcecoderepository.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_sourcecoderepository.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7f6a30d1ad478fd797bb1805179620a9080ea21a954781e7963fbaf3d2e0cf40
description: 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.
---
# SourceCodeRepository

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.

## Supported Calls

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

## Fields

| Field | Details |
| --- | --- |
| DefaultBranch | 
Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The name of the primary branch in the repository that contains all the changes you plan to release. In GitHub, this branch is typically called main.



 |
| ExternalRepositoryName | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The name of the repository as it appears on the provider. For example, my-dx-project.



 |
| 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 repository record.



 |
| OwnerId | 

Type

reference

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

The ID of the user or group that owns this record.

This field is a polymorphic relationship field.

Relationship Name

Owner

Refers To

Group, User



 |
| Provider | 

Type

picklist

Properties

Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update

Description

The provider of this repository.

Possible values are:

- BITBUCKET
- GITHUB

The default value is GITHUB.



 |
| ProviderInfo | 

Type

textarea

Properties

Create, Nillable, Update

Description

Additional provider-specific configuration or metadata in a JSON or text format.



 |
| RepositoryOwner | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The username or organization name that owns the repository.



 |
| SourceCodeRepoProviderId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the associated SourceCodeRepoProvider that handles the connection to this repository.

This field is a relationship field.

Relationship Name

SourceCodeRepoProvider

Refers To

SourceCodeRepoProvider



 |

## 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.

[SourceCodeRepositoryChangeEvent](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.

[SourceCodeRepositoryFeed](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.

[SourceCodeRepositoryHistory](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.

[SourceCodeRepositoryOwnerSharingRule](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.

[SourceCodeRepositoryShare](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

- [SourceCodeRepoProvider](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_sourcecoderepoprovider.htm "Represents a supported source (version) control system like GitHub or Bitbucket. This object is available in API version 66.0 and later.")
- [SourceCodeRepositoryBranch](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_sourcecoderepositorybranch.htm "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.")
- [DevopsProject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_devopsproject.htm "Represents a Lifecycle Center project. A project is the primary workspace where teams collaborate to manage changes for an app or customization. This object is the parent for all other Lifecycle Center objects, including pipelines, environments, and work items. This object is available in API version 67.0 and later.")