You are here:
(Optional) Seed a Source Control Repository with Org Metadata
If you’re currently using change sets to move changes to environments in your release pipeline, it’s likely that you don’t have a source control repository that contains your production org’s metadata. Although you can approach this task in any number of ways, this method uses the Salesforce (Developer Experience) DX tools that many of you’re already familiar with. However, those of you who don’t have any experience using DX developer tools can easily follow along.
Before you begin, install DevOps Center and the required developer tools. These steps were developed and tested using a GitHub repo.
After you create the DevOps Center project repository, you'll retrieve your metadata from a source org and then add those files to the repository. From now on, the source control repository’s main branch now becomes your source of truth for all your metadata and changes.
This method assumes:
- You have limited experience with Salesforce DX developer tools.
- You don’t currently use source control.
- You want to retrieve all (or most) your metadata from a source org, such as your release environment, to seed the source control repo.
- You haven’t customized the user interface or Git functionality in VS Code.
After you complete the tasks to seed the repo, you have a source control repository with a main branch. Continue configuring DevOps Center, then add environments and build your release pipeline, which creates the associated pipeline stage branches.
- Create a DevOps Center Project Repository
Create a project in DevOps Center, which creates a corresponding GitHub repository with the required Salesforce DX project structure. - Authorize the Source or Production Org
In Salesforce Extensions for VS Code, connect the release (production) org or source org that contains the metadata that you want to add to the source control repository. - Generate a Manifest and Retrieve Metadata From the Org
In Salesforce Extensions for VS Code, use Salesforce CLI to generate the manifest that contains the metadata types you want to retrieve from the production org. - Add the Local DX Project Files to the GitHub Repository
In Salesforce Extensions for VS Code, add the files you retrieved from your org to the DevOps Center project’s GitHub repository. The GitHub repository has the same name as the DevOps Center project name. After you add the files to the source control repository, the process creates the main branch, which you’ll associate with your release environment. Other branches for pipeline stages are created when you build your pipeline in DevOps Center.

