Share
Embed
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
81 slides
-
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott -
10/17/23 - 1 / 81 galvao.eti.br Git Branching Equívocos, Erros e Soluções v 0.2.0 - 2023-10-17 -
Atua há 30 anos no Mercado de TI: Programador (>
25), Professor / Palestrante (> 20) e Consultor (> 25) Engenheiro de Software Sênior / Tech Lead Professor Convidado (Especialista) de Pós-Graduação (PR e SC) Diretor, ConFLOSS, NodeConBR e PHP Conference Brasil Evangelista e Contribuidor para a Linguagem PHP Evangelista e Contribuidor para o Laminas Project Primeiro Brasileiro a se tornar Postman Supernova Presidente da ABRAPHP – Associação Brasileira de Profissionais PHP Apaixonado por Backend, APIs, Qualidade, Segurança e Software Livre galvao.eti.br galvao.eti.br Meu nome é Galvão CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/2023 – v0.2.0 – Slide 2 / 81 -
galvao.eti.br Objetivo CC Attribution-ShareAlike 3.0 Unported License by Er Galvão
Abbott - 10/17/23 - 3 / 81 Abrir o diálogo sobre versionamento e branching, pontos vitais em qualquer iniciativa de desenvolvimento. Como ocorre com infeliz frequência esses pontos – assim como diversos outros – não são debatidos o suficiente. E todos sofremos com isso. -
Quais palavras vêm a sua cabeça quando o assunto é
git? galvao.eti.br Problema #0 CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 4 / 81 -
Quais palavras vêm a sua cabeça quando o assunto é
git? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 5 / 81 Problema #0 -
Quais palavras vêm a sua cabeça quando o assunto é
git? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 6 / 81 Versão Branch Commit Pull Request Merge Hub Problema #0 -
Quais palavras vêm a sua cabeça quando o assunto é
git? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 7 / 81 Versão é importante, mas não é o conceito principal; Branch é importante, mas não é o conceito principal; Commit é importante, mas não é o conceito principal; Pull Request é importante, mas não é o conceito principal; Merge é importante, mas não é o conceito principal; Hub é importante, mas não é o conceito principal; Problema #0 -
Quais palavras vêm a sua cabeça quando o assunto é
git? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 8 / 81 Versão é importante, mas não é o conceito principal; Branch é importante, mas não é o conceito principal; Commit é importante, mas não é o conceito principal; Pull Request é importante, mas não é o conceito principal; Merge é importante, mas não é o conceito principal; Hub é importante, mas não é o conceito principal; O conceito principal é primordial: Problema #0 -
Quais palavras vêm a sua cabeça quando o assunto é
git? galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 9 / 81 Versão é importante, mas não é o conceito principal; Branch é importante, mas não é o conceito principal; Commit é importante, mas não é o conceito principal; Pull Request é importante, mas não é o conceito principal; Merge é importante, mas não é o conceito principal; Hub é importante, mas não é o conceito principal; O conceito principal é primordial: TEMPO Problema #0 -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 10 / 81 Quais palavras vêm a sua cabeça quando o assunto é git? Problema #0 -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 11 / 81 X Quais palavras vêm a sua cabeça quando o assunto é git? Problema #0 -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 12 / 81 -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 13 / 81 MAIN TEMPO 09h Tempo Main dev #1 dev #2 09h 09h - 09h dev #1 dev #2 -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 14 / 81 MAIN TEMPO 09h 09h30min dev #1 Tempo Main dev #1 dev #2 09h30min 09h 09h 09h dev #2 clone -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 15 / 81 MAIN TEMPO 09h 09h30min dev #1 dev #2 Tempo Main dev #1 dev #2 09h30min 09h 09h 09h -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 16 / 81 MAIN TEMPO 09h 09h30min dev #1 commit dev #2 Tempo Main dev #1 dev #2 10h 09h 10h 09h 10h -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 17 / 81 MAIN TEMPO 09h 09h30min dev #1 commit 10h 10h15min dev #2 Tempo Main dev #1 dev #2 10h15min 10h15min 10h15min 09h push -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 18 / 81 MAIN TEMPO 09h 09h30min dev #1 10h 10h15min dev #2 Tempo Main dev #1 dev #2 11h 10h15min 10h15min 10h15min 11h pull -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 19 / 81 MAIN TEMPO 09h 09h30min dev #1 10h 10h15min dev #2 Tempo Main dev #1 dev #2 11h 10h15min 10h15min 10h15min 11h -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 20 / 81 MAIN TEMPO 09h 09h30min dev #1 10h 10h15min dev #2 commit Tempo Main dev #1 dev #2 12h 10h15min 10h15min 12h 11h 12h -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 21 / 81 MAIN TEMPO 09h 09h30min dev #1 10h 10h15min dev #2 commit Tempo Main dev #1 dev #2 12h45min 12h 10h15min 12h 11h 12h45min 12h -
”Um turno na vida de um projeto” galvao.eti.br Solução #0
CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 22 / 81 MAIN TEMPO 09h 09h30min dev #1 10h 10h15min dev #2 Tempo Main dev #1 dev #2 12h45min 12h 12h 12h 11h 12h45min 12h pull -
“Fluxo ?! Que fluxo?” galvao.eti.br Problema #1 CC Attribution-ShareAlike 3.0
Unported License by Er Galvão Abbott - 10/17/23 - 23 / 81 -
“Fluxo?! Que fluxo?” galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by
Er Galvão Abbott - 10/17/23 - 24 / 81 Produção (main) TEMPO Desenvolvimento (dev) dev #1 dev #2 dev #n . . . Problema #1 -
FLUXO! galvao.eti.br Solução #1 CC Attribution-ShareAlike 3.0 Unported License by
Er Galvão Abbott - 10/17/23 - 25 / 81 -
Fluxo! galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão
Abbott - 10/17/23 - 26 / 81 Solução #1 ...mas qual fluxo? Gitflow Github Flow Trunk Based … ou … DIY!!! ? ? ? ? -
galvao.eti.br Problema #2, #3, #4 … #n! CC Attribution-ShareAlike 3.0
Unported License by Er Galvão Abbott - 10/17/23 - 27 / 81 “Eu vejo branches mortas” “De onde eu puxo?” “Main, dev, … ?!?!” … “Conflitos são coisa do mal” -
Doing it myself… or g-flow galvao.eti.br CC Attribution-ShareAlike 3.0 Unported
License by Er Galvão Abbott - 10/17/23 - 28 / 81 Solução #1 /galvao-eti/g-flow t -
1) Apresenta 4 tipos de branches: 1) Hotfix, Fix, Feature
e Epic. 2) Branches Iniciais: 1) Desenvolvimento; 2) Homologação; 3) Produção. 3) Estabilidade: A branch de Produção só é atualizada por Hotfixes e Releases. 4) Organização: Fluxos claros e completos para cada tipo de branch. 5) Simplicidade: Ferramenta bash para trabalhar com todos os tipos. galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott - 10/17/23 - 29 / 81 Conceitos -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 30 / 81 -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 31 / 81 Fluxo: Hotfix -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 32 / 81 Fluxo: Hotfix Após a identificação do bug o(a) Release Manager (RM) declara o início do Code Freeze. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 33 / 81 Fluxo: Hotfix Dev cria a branch com o nome no formato hotfix/issue a partir de Produção e imediatamente a cria remotamente -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 34 / 81 Fluxo: Hotfix Dev trabalha na sua branch, testa a correção localmente, faz o push para a sua branch remota e notifica o(a) RM -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 35 / 81 Fluxo: Hotfix O(a) RM faz o merge em Produção e Desenvolvimento -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 36 / 81 Fluxo: Hotfix Estando declarada a solução do bug, o(a) RM lança a release a partir de Produção ... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 37 / 81 Fluxo: Hotfix … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 38 / 81 Fluxo: Hotfix … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 39 / 81 Fluxo: Hotfix … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 40 / 81 Fluxo: Hotfix … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 41 / 81 Fluxo: Hotfix O período de Code Freeze é encerrado -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 42 / 81 Fluxo: Feature -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 43 / 81 Fluxo: Feature Dev cria a branch com o nome no formato feature/issue a partir de Produção e imediatamente a cria remotamente. Dev trabalha na sua branch, testa a feature localmente e faz pushes para a sua branch remota -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 44 / 81 Fluxo: Feature Ao concluir o trabalho, Dev abre uma PR para Desenvolvimento. É realizado o Code Review -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 45 / 81 Fluxo: Feature Se a PR for aprovada, o(a) RM faz o merge para Desenvolvimento e Homologação e declara o início do Code Freeze. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 46 / 81 Fluxo: Feature Em Homologação são realizados os testes de Regra de Negócio. Caso o trabalho seja homologado, ele é mergeado no ambiente de Homologação do Cliente -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 47 / 81 Fluxo: Feature Se o cliente homologar, o(a) RM lança a release a partir de Homologação... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 48 / 81 Fluxo: Feature … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 49 / 81 Fluxo: Feature … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 50 / 81 Fluxo: Feature … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 51 / 81 Fluxo: Feature … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 52 / 81 Fluxo: Feature O período de Code Freeze é encerrado -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 53 / 81 Fluxo: Epic Feature -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 54 / 81 Fluxo: Epic Feature É criada uma branch com o nome no formato epic/nome_epic a partir de Produção -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 55 / 81 Fluxo: Epic Feature Dev cria a branch com o nome no formato feature/issue a partir de epic/nome_epíc e imediatamente a cria remotamente. Dev trabalha na sua branch, testa a feature localmente e faz pushes para a sua branch remota -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 56 / 81 Fluxo: Epic Feature Ao concluir o trabalho, Dev abre uma PR para a branch da epic. É realizado o Code Review -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 57 / 81 Fluxo: Epic Feature Se a PR for aprovada, o(a) RM faz o merge para a branch da epic. Quando a epic estiver concluída e testada, Dev abre uma PR para Desenvolvimento -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 58 / 81 Fluxo: Epic Feature Se a PR for aprovada, o(a) RM faz o merge para Desenvolvimento e Homologação e declara o início do Code Freeze. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 59 / 81 Fluxo: Epic Feature Em Homologação são realizados os testes de Regra de Negócio. Caso o trabalho seja homologado, ele é mergeado no ambiente de Homologação do Cliente -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 60 / 81 Fluxo: Epic Feature Se o cliente homologar, o(a) RM lança a release a partir de Homologação... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 61 / 81 Fluxo: Epic Feature … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 62 / 81 Fluxo: Epic Feature … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 63 / 81 Fluxo: Epic Feature … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 64 / 81 Fluxo: Epic Feature … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 65 / 81 Fluxo: Epic Feature O período de Code Freeze é encerrado. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 66 / 81 Fluxo: Fix -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 67 / 81 Fluxo: Fix Dev cria a branch com o nome no formato fix/issue a partir de Produção e imediatamente a cria remotamente. Dev trabalha na sua branch, testa o fix localmente e faz pushes para a sua branch remota -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 68 / 81 Fluxo: Fix Ao concluir o trabalho, Dev abre uma PR para Desenvolvimento. É realizado o Code Review -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 69 / 81 Fluxo: Fix Se a PR for aprovada, o(a) RM faz o merge para Desenvolvimento e Homologação e declara o início do Code Freeze -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 70 / 81 Fluxo: Fix Em Homologação são realizados os testes de Regra de Negócio. Caso o trabalho seja homologado, ele é mergeado no ambiente de Homologação do Cliente -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 71 / 81 Fluxo: Fix Se o cliente homologar, o(a) RM lança a release a partir de Homologação... -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 72 / 81 Fluxo: Fix … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 73 / 81 Fluxo: Fix … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 74 / 81 Fluxo: Fix … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 75 / 81 Fluxo: Fix … e faz o merge para todas as branches de Homologação e Produção. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 76 / 81 Fluxo: Fix O período de Code Freeze é encerrado. -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 77 / 81 Daqui pra onde…? t ? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 78 / 81 Daqui pra onde…? -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 79 / 81 Daqui pra onde…? Variações dev -
galvao.eti.br CC Attribution-ShareAlike 3.0 Unported License by Er Galvão Abbott
- 10/17/23 - 80 / 81 Daqui pra onde…? Variações, ou evoluindo a g-flow dev -
galvao.eti.br Muito Obrigado! CC Attribution-ShareAlike 3.0 Unported License by Er
Galvão Abbott - 10/17/23 - 81 / 81 Dúvidas, Críticas, Elogios, etc…? ‘bora conversar!