Branch Management Setup
Copado Branch Management is a feature-based license that establishes the connections between orgs to form a sandbox landscape. It allows you to keep Salesforce orgs' metadata and Git branches effortlessly in sync.
How to Set It Up
- 1 Git repository.
- For each environment within your deployment flow, 1 branch must be created within your Git repository. Note that branch names are case sensitive.
- All branches must start in sync, all in the same commit id, which will be the common starting point. When creating new branches, all branches must be created from the same 'master' branch.
- Make sure you have Copado Branch Management enabled from the Account Summary tab.
- Create the org credentials that will be part of the deployment flow.
- Rename the environments (it is strongly recommended to rename the environments with the same name as the branches).
- Add Branch Management Permissions to each environment. Make sure the related list is included in the environment layout.
- Create a new empty git repository in your git server.
- Create a .gitignore file in the master branch (this should be the first file of the repository).
#package.xml file is recreated on the fly by Copado, no need to track
#unnecessary changes of this file
#Managed packages can trigger the installation or uninstallation of
#applications, it is recommended to manage this outside git
#if you are not customizing a managed package, you can keep your
#repository clean by ignoring all files for that package.
#For example, to ignore all files of the "Copado" managed package
#just add to your .gitignore file the following text: *copado__*
#if you will be customizing managed packages, make sure that the
#same version of the package is installed on all your environments
#so that deployments will only update existing managed components.
#Creation of managed components is not permitted by the API.
#It is recommended that you ignore managed components that cannot be
#modified since there is no need to track them in Git,
#like for example:
#profiles and permission sets are complex Files. If your Org's
#metadata and Git are in sync, you can track incremental changes on
#Profiles and Permission sets using Copado "commit files" functionality.
#Otherwise ignore profiles and permission sets until you are ready for it.
#You can deploy profiles and permission sets using
#Copado Deployer steps: Full profiles and Full Permission sets.
# Below is how to ignore them
#Translations are complex since get updated indirectly across
#multiple files, they can make a deployment fail if a field is
#translated in source and it doesn't exist on destination.
#If you are committing incrementally new fields and new Translations
#you can track them in Git, just be careful.
#If you choose to ignore them in Git, you can always create a deployment
#with the Copado Deployer "Translation" Step.
#Sites which has Domain mapping has environment specific information.
#Make sure you setup Copado Environment Variables to make sites config
#files environment agnostic.
#Until the above is achieved, you can ignore them as follows
- Create a git repository in Copado that connects to the one created in a previous step.
- Create a deployment flow (including the repository and the main branch). Make sure these two fields are included in the layout.
- Add all the deployment steps by setting the destination org and then the branch.
- Create snapshots for each org -> branch (without running them yet).
- For master branch, set permissions to Allow Snapshots and Commits.
- For all the other branches, set permissions to Allow Commits Only.
- Initialize the master branch by running the Git snapshot for the master branch.
- On the Git server, create all the branches based on the master branch.
- Edit the snapshot for the master branch and set permissions to Allow Commits Only.
- From the deployment flow, go to Manage Branches and click on Recalculate. All branches should be displayed in sync after the recalculation.
You are all set! Now you can start creating commits into the different branches and Copado will do its magic.