Tower Help & Support

GitLab Workflow

Tower's GitLab Workflow template implements a branching strategy based on GitLab Flow, which uses different environment branches to represent various stages of your deployment pipeline. This approach is particularly well-suited for web development projects where changes flow through multiple environments before reaching production, regardless of whether you use GitLab as your Git hosting service.

About GitLab Flow

GitLab Flow was developed by GitLab as a workflow that bridges the gap between GitHub Flow's simplicity and Git-Flow's structure. The workflow was designed to accommodate the reality of modern web development, where applications typically move through multiple environments (development, staging, production) before being fully deployed.

The name "GitLab Flow" originates from its creation by the GitLab team, who developed this workflow to solve specific challenges they observed in software development teams. While it was initially designed for GitLab's platform, the principles work effectively with any Git hosting service, making it a versatile choice for teams regardless of their infrastructure choices.

Environment-Based Branching

The GitLab Workflow template centers around environment-specific branches that mirror your deployment pipeline:

Main branch contains development work and serves as the integration point for new features and changes.

Staging branch represents your staging environment, where changes are tested and validated before production deployment.

Production branch reflects your production environment and contains only code that has been thoroughly tested and approved for end users.

This structure creates a clear progression path where changes flow from main to staging to production, with each branch representing a specific environment state. The approach ensures that your Git branches match your actual deployment environments, reducing confusion and deployment errors.

Perfect for Web Development

GitLab Workflow excels in web development scenarios where multiple environments are standard practice. The workflow naturally supports common web development patterns:

Environment parity ensures your branches match your actual server environments, making it easy to understand what code is running where.

Staged deployments allow you to test changes in staging before they reach production users, providing an additional quality gate.

Rollback capabilities are simplified because each environment branch represents a known-good state that you can quickly deploy.

Feature validation happens in staging, where you can test new features with realistic data and configurations before exposing them to production users.

How Changes Flow

The GitLab Workflow follows a deliberate progression pattern:

  1. Feature development happens on feature branches created from main
  2. Integration occurs when feature branches are merged back to main
  3. Staging deployment happens by merging main into the staging branch
  4. Production deployment occurs by merging staging into the production branch

This flow ensures that all changes pass through your complete testing pipeline and that each environment branch accurately represents what's deployed in that environment.

Benefits for Web Projects

GitLab Workflow provides several advantages specifically valuable for web development teams:

Clear environment mapping eliminates confusion about which version of your application is running in which environment.

Gradual rollout allows you to deploy changes to staging first, validate them, and then promote to production with confidence.

Hotfix handling can be managed by creating fixes against the production branch and then merging back to staging and main to keep environments synchronized.

Database migration coordination becomes easier because you can run migrations in staging first and validate them before applying to production.

Customization Options

While the basic GitLab Workflow template provides environment branches for staging and production, Tower's implementation allows customization for different deployment scenarios:

Additional environments can be added for teams that use development, QA, staging, and production environments.

Branch naming can be adjusted to match your team's terminology or organizational conventions.

Merge strategies can be configured differently for each environment branch to match your deployment requirements.

Automated deployment triggers can be integrated to automatically deploy when specific branches are updated.

When to Choose GitLab Workflow

GitLab Workflow works best for teams that:

  • Deploy web applications through multiple environments
  • Need clear separation between development, staging, and production code
  • Want their Git branches to mirror their deployment pipeline
  • Require a structured approach to environment promotions
  • Work on projects where thorough testing in staging is critical

This workflow is less suitable for desktop applications, libraries, or projects where immediate deployment from a single branch is preferred.

Getting Started

When you select the GitLab Workflow template, Tower configures:

  • A main base branch for ongoing development work
  • A staging base branch representing your staging environment
  • A production base branch representing your production environment
  • feature/ topic branches that merge into main
  • Appropriate merge strategies for environment promotions

Ideal for Multi-Environment Deployments GitLab Workflow provides the perfect structure for web development teams that need to validate changes through multiple environments before production deployment.

This configuration provides immediate support for environment-based development while allowing you to customize the specific environment names, merge strategies, and deployment triggers to match your infrastructure and processes.