Key takeaways - The workflow is great for a release-based software workflow. - Gitflow offers a dedicated channel for hotfixes to [[Production environment]]. The overall flow of Gitflow 1. A `develop` branch is created from `main` 2. A `release` branch is created from `develop` 3. `Feature` branches are created from `develop` 4. When a `feature` is complete it is merged into the `develop` branch 5. When the `release` branch is done it is merged into `develop` and `main` 6. If an issue in `main` is detected a `hotfix` branch is created from `main` 7. Once the `hotfix` is complete it is merged to both `develop` and `main` ## Main & develop - `main` - branch stores the official release history - `develop` - serves as an integration branch for features ![[Use Tags for Releases]] ![](https://wac-cdn.atlassian.com/dam/jcr:a13c18d6-94f3-4fc4-84fb-2b8f1b2fd339/01%20How%20it%20works.svg?cdnVersion=1528) ## Feature branch ```bash # creating git checkout develop git checkout -b <feature_branch> # finishing git checkout develop git merge <feature_branch> ``` ![](https://wac-cdn.atlassian.com/dam/jcr:34c86360-8dea-4be4-92f7-6597d4d5bfae/02%20Feature%20branches.svg?cdnVersion=1528) ## Release branch ```bash # start git checkout develop git checkout -b release/0.1.0 # ready to ship git checkout main git merge release/0.1.0 ``` ![](https://wac-cdn.atlassian.com/dam/jcr:8f00f1a4-ef2d-498a-a2c6-8020bb97902f/03%20Release%20branches.svg?cdnVersion=1528) ## Hotfixes ```bash # starting git checkout main git checkout -b hotfix_branch # merging git checkout main git merge hotfix_branch git checkout develop git merge hotfix_branch git branch -D hotfix_branch ``` ![](https://wac-cdn.atlassian.com/dam/jcr:cc0b526e-adb7-4d45-874e-9bcea9898b4a/04%20Hotfix%20branches.svg?cdnVersion=1528) https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow