Workflows
Git Flow
Git Flow is a branching model for Git, designed around project releases. It encompasses a strict branching model, designed for managing larger projects.
Main Components: - Master branch: Always reflects a production-ready state. - Develop branch: Serves as an integration branch for features. - Feature branches: Branch off from develop and merge back into develop. - Release branches: Branch off from develop and merge into develop and master. - Hotfix branches: Branch off from master and merge into develop and master.
Example Workflow: 1. Start a new feature:
GitHub Flow
GitHub Flow is a lightweight, branch-based workflow that supports teams and projects where deployments are made regularly.
Main Components: - Main branch: Production-ready state at all times. - Feature branches: Branch off from main and should be deployed to production once their PRs are merged.
Example Workflow: 1. Create a branch:
Trunk-Based Development
Trunk-Based Development is a version control strategy where developers collaborate on code in a single branch called "trunk", minimizing the existence of long-lived branches.
Main Components: - Trunk/Main branch: Single source of truth for the current state of the project. - Short-lived feature branches: Typically exist for less than a day before merged into trunk. - Optional release branches: For teams releasing less frequently.
Example Workflow: 1. Developers create short-lived feature branches off the trunk:
In Trunk-Based Development, the focus is on keeping the branches short-lived to encourage continuous integration and minimize merge conflicts.