name: portada class: portada-slide, middle, right # GitFlow ## __UD8:__ GitFlow .footnote[Joan Puigcerver Ibáñez ([j.puigcerveribanez@edu.gva.es](mailto:j.puigcerveribanez@edu.gva.es))] --- layout: true class: regular-slide .right[.logo[]] --- # Estructura  --- # Branques
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%% gitGraph commit id:"0. Initial commit" branch develop order:2 branch feature/one order: 3 branch feature/two order: 4
``` git init git branch develop git branch checkout git branch feature/one git branch feature/two ``` --- # Features
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%% gitGraph commit id:"0. Initial commit" branch develop order:2 branch feature/one order: 3 branch feature/two order: 4 checkout feature/one commit id:"1. Títol" checkout feature/two commit id:"2. Col·aboradors" checkout feature/one commit id:"3. Descripció"
```bash git checkout feature/X vi README.md # Make changes git add README.md git commit -m "Commit Message" ``` --- # Merge to develop
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%% gitGraph commit id:"0. Initial commit" branch develop order:2 branch feature/one order: 3 branch feature/two order: 4 checkout feature/one commit id:"1. Títol" checkout feature/two commit id:"2. Col·aboradors" checkout feature/one commit id:"3. Descripció" checkout develop merge feature/one
```bash git checkout develop git merge feature/X ``` --- # Features (II)
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%% gitGraph commit id:"0. Initial commit" branch develop order:2 branch feature/one order: 3 branch feature/two order: 4 checkout feature/one commit id:"1. Títol" checkout feature/two commit id:"2. Col·aboradors" checkout feature/one commit id:"3. Descripció" checkout develop merge feature/one branch feature/three order: 5 commit id:"4. Bibliografia" checkout develop merge feature/three
--- # Features (II) ```bash git checkout feature/X vi README.md # Make changes git add README.md git commit -m "Commit Message" git checkout develop git merge feature/X ``` --- # Rebase
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%% gitGraph commit id:"0. Initial commit" branch develop order:2 branch feature/one order: 3 checkout feature/one commit id:"1. Títol" commit id:"3. Descripció" checkout develop merge feature/one branch feature/three order: 5 commit id:"3. Bibliografia" checkout develop merge feature/three branch feature/two order: 4 checkout feature/two commit id:"4. Col·aboradors" checkout develop merge feature/two
--- # Rebase ```bash git checkout feature/X git rebase develop vi README.md # Fix possible conflicts git add README.md git commit git checkout develop git merge feature/X ``` --- # Release
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%% gitGraph commit id:"0. Initial commit" branch develop order:2 branch feature/one order: 3 checkout feature/one commit id:"1. Títol" commit id:"3. Descripció" checkout develop merge feature/one branch feature/three order: 5 commit id:"3. Bibliografia" checkout develop merge feature/three branch feature/two order: 4 checkout feature/two commit id:"4. Col·aboradors" checkout develop merge feature/two branch release/v0.1 order: 1 commit id:"5. Prepare v0.1" checkout main merge release/v0.1 checkout develop merge release/v0.1
--- # Release ```bash git checkout develop git branch release/v0.1 git checkout release/v0.1 vi README.md # Prepare release git add README.md git commit git checkout main git merge release/v0.1 git checkout develop git merge release/v0.1 ``` --- # Hotfix
%%{init: { 'logLevel': 'debug', 'theme': 'forest' } }%% gitGraph commit id:"0. Initial commit" branch develop order: 3 branch feature/one order: 4 checkout feature/one commit id:"1. Títol" commit id:"3. Descripció" checkout develop merge feature/one branch feature/three order: 6 commit id:"3. Bibliografia" checkout develop merge feature/three branch feature/two order: 5 checkout feature/two commit id:"4. Col·aboradors" checkout develop merge feature/two branch release/v0.1 order: 2 commit id:"5. Prepare v0.1" checkout main merge release/v0.1 checkout develop merge release/v0.1 checkout main branch hotfix/versio order: 1 checkout hotfix/versio commit id:"6. Fix versio" checkout main merge hotfix/versio checkout develop merge hotfix/versio
--- # Hotfix ```bash git checkout main git branch hotfix/versio vi README.md # Hotfix git add README.md git commit git checkout main git merge hotfix/versio git checkout develop git merge hotfix/versio ```