📄️ Git Strategies
Git is becoming an essential part of Salesforce projects, although some projects still rely on changesets for delivery.
📄️ Trunk-Based Development (TBD)
The Trunk-Based Development (TBD) strategy is applied in projects where the main values are release frequency and speed. It is characterized by frequent commits and merges into a single main branch. If feature branches are used, they exist for no longer than a few days or hours. Under this strategy, the main branch is always ready for deployment to production, although release branches may also be used. This approach is more often used in small teams due to the need for close interaction and good communication among developers, clear process organization, and discipline.
📄️ Git Flow
Git Flow is a popular branching strategy in Git, developed by Vincent Driessen link, for a structured development process. The main branches are main for production code and develop for integrating new features. Feature branches are created from develop and merged back after completion. Release branches prepare releases, merging into both main and develop. Hotfix branches are for urgent production code fixes and also merge into both main branches. This strategy supports parallel development, simplifies large project management, and minimizes conflicts.
📄️ Copado Branching Strategy
Copado Branching Strategy is recognized as an independent strategy due to its unique approach to building a Git strategy. This strategy is part of the change delivery process using the Copado tool. It involves the use of separate branches for each user story or feature and supports regular back-promotion to synchronize changes between branches.
📄️ Parallel Releases
The Parallel Release Git strategy allows managing multiple versions of a product simultaneously. Separate release branches (release-x.x) are created for each release, enabling the preparation and testing of different product versions in parallel. Feature branches can be created from release-x.x branches, which serve as develop branches for the corresponding releases. This approach helps isolate changes and manage multiple product versions simultaneously, which is especially useful for projects with long development cycles and support for older versions. However, it requires strict branch management and synchronization of changes. An important feature is the designation of major and minor releases for their sequential synchronization.
📄️ Git Fork Strategy
The Fork Git Strategy is an approach to repository and branch management primarily used in open-source projects but can also be effectively applied in corporate projects. This strategy allows developers to work on a project without having direct access to the main repository. Instead, they create their own copies (forks) of the main repository and make changes to them. The Fork Git Strategy provides an excellent solution for isolating changes, enhancing security, and ensuring code quality, but it requires careful organization and management, especially in a corporate environment. This strategy is effective for projects with a large number of contributors and external contractors.
📄️ Org Branch
The Git Org Branch Strategy, where each branch corresponds to a specific environment (e.g., development, UAT, staging, production), is a useful concept for managing changes and deployments in corporate and large projects. This strategy is common in Salesforce projects due to licensing policies and environment setups that may not allow for full testing environments and limited use of Infrastructure as Code (IaC) approaches.
📄️ Feature Branch
The Feature Branch strategy is an approach to branch management in version control systems where each new feature is developed in a separate branch originating from the main development branch (main, int, dev). This allows changes to be isolated and minimizes risks associated with integration.
📄️ HotFix
The Hotfix Git Strategy aims to deliver fixes to the production environment as quickly and reliably as possible. The hotfix strategy is an integral part of the overall change management and deployment strategy adopted for the project.
📄️ Anti-patterns
1. Lack of Clear Structure and Documentation: Implementing Git strategies without clear documentation and structure can lead to chaos. Developers may not understand which branches to use and in what order to merge.