This document describes GitFlow, a Git branching model for managing code development. It outlines the main branches (master, develop/edge), feature branches for new work, release branches for final testing, and hotfix branches for critical fixes. Feature branches are merged into develop/edge after completion. Release branches are created from develop/edge for final testing before being merged to master and tagged. Hotfix branches address critical issues directly in master. The GitFlow workflow provides a robust model for team collaboration and code releases.
2. Esta obra está licenciada bajo la Licencia Creative Commons Atribución-CompartirIgual 4.0 Internacional. Para ver una
copia de esta licencia, visita http://creativecommons.org/licenses/by-sa/4.0/.
18. Master a Master
MasterMaster
El Server
No es posible corregir el bug hasta completar el feature
V0.1.0 abc001
abc002
Nuevo Feature abc001
abc003
abc123 ¡BUG!
Feature
Incompleto
35. Release Branch
Congelamos el código del release
Edge Release/0.2.0
Feature/A
Master
Bump a 0.2.0
V0.1.0
$ git checkout –b release/0.2.0 edge
< bump de la version de mi codigo >
$ git commit –am “Bump 0.2.0”
42. Finalizar Release
Master está estable y Edge tiene nuevos features.
Release/0.2.0Master
V0.1.0
V0.2.0
Edge
Feature/A
Feature/A
Feature/A
Feature/B
Feature/C
A, B y C
45. Hotfix Branch
Generamos un hotfix branch y hacemos bump de la version
Hotfix MasterEdge
v0.2.0
$ git branch –d hotfix/0.2.1 master
<Bump de version a 0.2.1>
$ git commit –am “Bump a 0.2.1”
52. Inicializar Repositorio
➜ mi-app git:(master) ✗ git flow init
No branches exist yet. Base branches must be created now.
Branch name for production releases: [master]
Branch name for "next release" development: [develop] edge
How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []
➜ mi-app git:(edge) ✗
53. Feature Branch
➜ mi-app git:(edge) ✗ git flow feature start homepage
Switched to a new branch 'feature/homepage'
Summary of actions:
- A new branch 'feature/homepage' was created, based on 'edge'
- You are now on branch 'feature/homepage'
Now, start committing on your feature. When done, use:
git flow feature finish homepage
➜ mi-app git:(feature/homepage) ✗
54. Finalizar Feature Branch
➜ mi-app git:(feature/homepage) git flow feature finish homepage
Switched to branch 'edge'
Updating 4d2c7d8..0812b3b
Fast-forward
hello.txt | 0
homepage.html | 0
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 hello.txt
create mode 100644 homepage.html
Deleted branch feature/homepage (was 0812b3b).
Summary of actions:
- The feature branch 'feature/homepage' was merged into 'edge'
- Feature branch 'feature/homepage' has been removed
- You are now on branch 'edge'
➜ mi-app git:(edge)
55. Release Branch
➜ mi-app git:(edge) git flow release start v0.1.0
Switched to a new branch 'release/v0.1.0'
Summary of actions:
- A new branch 'release/v0.1.0' was created, based on 'edge'
- You are now on branch 'release/v0.1.0'
Follow-up actions:
- Bump the version number now!
- Start committing last-minute fixes in preparing your release
- When done, run:
git flow release finish 'v0.1.0’
➜ mi-app git:(release/v0.1.2)
56. Release Branch
➜ mi-app git:(release/v0.1.0) git flow release finish v0.1.0
Switched to branch 'master'
Merge made by the 'recursive' strategy.
hello.txt | 0
homepage.html | 0
2 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 hello.txt
create mode 100644 homepage.html
Deleted branch release/v0.1.0 (was 0812b3b).
Summary of actions:
- Latest objects have been fetched from 'origin'
- Release branch has been merged into 'master'
- The release was tagged 'v0.1.0'
- Release branch has been back-merged into 'edge'
- Release branch 'release/v0.1.0' has been deleted
➜ mi-app git:(master)
57. Hotfix Branch
➜ mi-app git:(master) git flow hotfix start v0.1.1
Switched to a new branch 'hotfix/v0.1.1'
Summary of actions:
- A new branch 'hotfix/v0.1.1' was created, based on 'master'
- You are now on branch 'hotfix/v0.1.1'
Follow-up actions:
- Bump the version number now!
- Start committing your hot fixes
- When done, run:
git flow hotfix finish 'v0.1.1'
➜ mi-app git:(hotfix/v0.1.1)
58. Hotfix Branch
➜ mi-app git:(hotfix/v0.1.1) ✗ git commit -am "Fix bug #123"
[hotfix/v0.1.1 f7f9caa] Fix bug #123
1 file changed, 1 insertion(+)
➜ mi-app git:(hotfix/v0.1.1) git flow hotfix finish v0.1.1
Switched to branch 'master'
Merge made by the 'recursive' strategy.
homepage.html | 1 +
1 file changed, 1 insertion(+)
Switched to branch 'edge'
Merge made by the 'recursive' strategy.
homepage.html | 1 +
1 file changed, 1 insertion(+)
Deleted branch hotfix/v0.1.1 (was f7f9caa).
Summary of actions:
- Latest objects have been fetched from 'origin'
- Hotfix branch has been merged into 'master'
- The hotfix was tagged 'v0.1.1'
- Hotfix branch has been back-merged into 'edge'
- Hotfix branch 'hotfix/v0.1.1' has been deleted
➜ mi-app git:(edge)