Git Repository and Main Release Flow

Updated 2 weeks ago by Copado Solutions

  1. Create a new repository in your Git version control provider (e.g. Github, Bitbucket, GitLab, others).
  2. Commit the example .gitignore file to the master branch to avoid tracking unnecessary files, thus keeping your branches only with the necessary files.
  3. Link Copado to your Git repository.
    • If your Git repository is behind a firewall, you will need to whitelist the Copado IP Addresses.
    • It is recommended that developers and admins working with Copado have access to the Git repository to review their changes and see who modified specific lines of code or configuration files.
  4. Create a Git snapshot record for the production org with the master branch.
    • A Git snapshot links an org to a Git branch in your Git repository in order to perform actions such as backups, commit to the branch, or commit metadata changes via a user story.
    • The user story’s org credential will determine which Git snapshot will be used for the commit.
  5. Follow Salesforce’s Git trailhead for more information on version control.
  6. Click on Create Snapshot Now in the Git Snapshot record that links the production org to the master branch of your Git repository. All the metadata components of the org, which are not mentioned in the .gitignore file, will be committed to the branch.
  7. Once the snapshot is finished, verify in your Git repository that the metadata components have been committed to the master branch. Then, create new branches out of the master branch that correspond to each of the other orgs (e.g. dev1, int, UAT).
  8. In Copado, create the Git snapshot records for each of the other orgs with their corresponding branch and org credential. Branch names are case sensitive, therefore, make sure to check that the branch name in git is exactly the same as that in the snapshot in Copado.
    • Consider creating a Release Management user in each org that has access to all the metadata. Link each Git Snapshot record to the org credential of the Release Management user.
    • Users that will be committing to user stories need access to a Git snapshot record linked to an org credential linked to the same environment of the user story. If they do not have access to this Git snapshot, you must share the org credential record with them so they have access to the Git snapshot.
  9. Create a deployment flow. Select the Git repository record and the main branch to track all metadata changes in Git. The main branch is usually master, from which the user story feature branches will be created.
  10. Create deployment flow steps to connect the different orgs of the deployment flow. For each step, select the source and destination environments and type in the branch related to the source environment.
  11. In the deployment flow click on Manage Branches and then on Recalculate. All the environments will be marked as In Sync, since the branches in Git have been created from master and there are no committed changes yet.
    • When first implementing Copado Branch Management, your branches are in sync between each other but not in sync with their corresponding org. You will have to either refresh your sandboxes for them to be in sync with the Git branches or gradually resolve the differences. Click here for more information.


How did we do?