Submit Search
Upload
#3 - Git - Branching e Merging
•
6 likes
•
1,027 views
Rodrigo Branas
Follow
Branching e Merging com Git.
Read less
Read more
Software
Report
Share
Report
Share
1 of 149
Download now
Download to read offline
Recommended
#2 - Git - DAG
#2 - Git - DAG
Rodrigo Branas
Git training v10
Git training v10
Skander Hamza
Git real slides
Git real slides
Lucas Couto
Introduction to Git
Introduction to Git
Yan Vugenfirer
Git & GitLab
Git & GitLab
Gaurav Wable
GIT_In_90_Minutes
GIT_In_90_Minutes
vimukthirandika
Git Lab Introduction
Git Lab Introduction
Krunal Doshi
Workshop git para iniciantes
Workshop git para iniciantes
Paula Santana
Recommended
#2 - Git - DAG
#2 - Git - DAG
Rodrigo Branas
Git training v10
Git training v10
Skander Hamza
Git real slides
Git real slides
Lucas Couto
Introduction to Git
Introduction to Git
Yan Vugenfirer
Git & GitLab
Git & GitLab
Gaurav Wable
GIT_In_90_Minutes
GIT_In_90_Minutes
vimukthirandika
Git Lab Introduction
Git Lab Introduction
Krunal Doshi
Workshop git para iniciantes
Workshop git para iniciantes
Paula Santana
Git Terminologies
Git Terminologies
Yash
Routed Fabrics For Ceph
Routed Fabrics For Ceph
ShapeBlue
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Thomas Graf
Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...
Bilgin Ibryam
VMware Tanzu Kubernetes Connect
VMware Tanzu Kubernetes Connect
VMware Tanzu
K8s - Setting up minikube
K8s - Setting up minikube
Vinicius M Grippa
Learning git
Learning git
Sid Anand
Présentation de git
Présentation de git
Julien Blin
Introduction to Git and Github
Introduction to Git and Github
Roland Emmanuel Salunga
Git and git workflow best practice
Git and git workflow best practice
Majid Hosseini
Migrating To GitHub
Migrating To GitHub
Sridhar Peddinti
Git advanced
Git advanced
Peter Vandenabeele
VSAN – Architettura e Design
VSAN – Architettura e Design
VMUG IT
Continuous Integration & Continuous Delivery
Continuous Integration & Continuous Delivery
Databricks
Git basics
Git basics
GHARSALLAH Mohamed
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
Kenny Gryp
Kubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
Stefan Schimanski
Ceph and Openstack in a Nutshell
Ceph and Openstack in a Nutshell
Karan Singh
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
Wagner Bianchi
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Thomas Graf
Git-ing out of your git messes - Fluent Conf 2017
Git-ing out of your git messes - Fluent Conf 2017
Katie Sylor-Miller
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto
Rodrigo Branas
More Related Content
What's hot
Git Terminologies
Git Terminologies
Yash
Routed Fabrics For Ceph
Routed Fabrics For Ceph
ShapeBlue
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Thomas Graf
Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...
Bilgin Ibryam
VMware Tanzu Kubernetes Connect
VMware Tanzu Kubernetes Connect
VMware Tanzu
K8s - Setting up minikube
K8s - Setting up minikube
Vinicius M Grippa
Learning git
Learning git
Sid Anand
Présentation de git
Présentation de git
Julien Blin
Introduction to Git and Github
Introduction to Git and Github
Roland Emmanuel Salunga
Git and git workflow best practice
Git and git workflow best practice
Majid Hosseini
Migrating To GitHub
Migrating To GitHub
Sridhar Peddinti
Git advanced
Git advanced
Peter Vandenabeele
VSAN – Architettura e Design
VSAN – Architettura e Design
VMUG IT
Continuous Integration & Continuous Delivery
Continuous Integration & Continuous Delivery
Databricks
Git basics
Git basics
GHARSALLAH Mohamed
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
Kenny Gryp
Kubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
Stefan Schimanski
Ceph and Openstack in a Nutshell
Ceph and Openstack in a Nutshell
Karan Singh
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
Wagner Bianchi
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Thomas Graf
What's hot
(20)
Git Terminologies
Git Terminologies
Routed Fabrics For Ceph
Routed Fabrics For Ceph
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Application modernization patterns with apache kafka, debezium, and kubernete...
Application modernization patterns with apache kafka, debezium, and kubernete...
VMware Tanzu Kubernetes Connect
VMware Tanzu Kubernetes Connect
K8s - Setting up minikube
K8s - Setting up minikube
Learning git
Learning git
Présentation de git
Présentation de git
Introduction to Git and Github
Introduction to Git and Github
Git and git workflow best practice
Git and git workflow best practice
Migrating To GitHub
Migrating To GitHub
Git advanced
Git advanced
VSAN – Architettura e Design
VSAN – Architettura e Design
Continuous Integration & Continuous Delivery
Continuous Integration & Continuous Delivery
Git basics
Git basics
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11
Kubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
Ceph and Openstack in a Nutshell
Ceph and Openstack in a Nutshell
MySQL Multi-Source Replication for PL2016
MySQL Multi-Source Replication for PL2016
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Similar to #3 - Git - Branching e Merging
Git-ing out of your git messes - Fluent Conf 2017
Git-ing out of your git messes - Fluent Conf 2017
Katie Sylor-Miller
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto
Rodrigo Branas
Understanding git
Understanding git
Avik Das
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
Boise Web Technologies Group
Sacándole jugo a git
Sacándole jugo a git
Berny Cantos
M.Mozūras - git
M.Mozūras - git
Agile Lietuva
Bend time to your will with git
Bend time to your will with git
Chris Tankersley
Keep you GIT history clean
Keep you GIT history clean
tomasbro
Git社内勉強会
Git社内勉強会
Hirata Daichi
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
tmacwilliam
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub Workshop
All Things Open
Git For The Android Developer
Git For The Android Developer
Effective
Git Started With Git
Git Started With Git
Nick Quaranto
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
Becky Todd
Get Good With Git
Get Good With Git
Hoffman Lab
Keep your GIT history clean
Keep your GIT history clean
tomasbro
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Codemotion
Git-ing out of your git messes
Git-ing out of your git messes
Katie Sylor-Miller
git internals
git internals
Dennis Byrne
Git Without Puns
Git Without Puns
Chicago ALT.NET
Similar to #3 - Git - Branching e Merging
(20)
Git-ing out of your git messes - Fluent Conf 2017
Git-ing out of your git messes - Fluent Conf 2017
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto
Understanding git
Understanding git
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
Sacándole jugo a git
Sacándole jugo a git
M.Mozūras - git
M.Mozūras - git
Bend time to your will with git
Bend time to your will with git
Keep you GIT history clean
Keep you GIT history clean
Git社内勉強会
Git社内勉強会
Git Magic: Versioning Files like a Boss
Git Magic: Versioning Files like a Boss
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub Workshop
Git For The Android Developer
Git For The Android Developer
Git Started With Git
Git Started With Git
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
Get Good With Git
Get Good With Git
Keep your GIT history clean
Keep your GIT history clean
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Git-ing out of your git messes
Git-ing out of your git messes
git internals
git internals
Git Without Puns
Git Without Puns
More from Rodrigo Branas
Clean Architecture
Clean Architecture
Rodrigo Branas
Node.js - #7 - Core Modules - http - Parte 1 - Rodrigo Branas
Node.js - #7 - Core Modules - http - Parte 1 - Rodrigo Branas
Rodrigo Branas
Node.js - #6 - Core Modules - net - Rodrigo Branas
Node.js - #6 - Core Modules - net - Rodrigo Branas
Rodrigo Branas
Node.js - #5 - Process - Rodrigo Branas
Node.js - #5 - Process - Rodrigo Branas
Rodrigo Branas
Node.js - #4 - Timers - Rodrigo Branas
Node.js - #4 - Timers - Rodrigo Branas
Rodrigo Branas
Node.js - #3 - Global Objects - Rodrigo Branas
Node.js - #3 - Global Objects - Rodrigo Branas
Rodrigo Branas
Node.js - #2 - Sistema de Módulos - Rodrigo Branas
Node.js - #2 - Sistema de Módulos - Rodrigo Branas
Rodrigo Branas
Node.js - #1 - Introdução - Rodrigo Branas
Node.js - #1 - Introdução - Rodrigo Branas
Rodrigo Branas
#6 - Git - Desfazendo as coisas
#6 - Git - Desfazendo as coisas
Rodrigo Branas
#1 - Git - Introdução
#1 - Git - Introdução
Rodrigo Branas
#4 - Git - Stash
#4 - Git - Stash
Rodrigo Branas
A evolução do AngularJS
A evolução do AngularJS
Rodrigo Branas
JavaScript - Date
JavaScript - Date
Rodrigo Branas
JavaScript - Expressões Regulares
JavaScript - Expressões Regulares
Rodrigo Branas
Automação de Testes com AngularJS
Automação de Testes com AngularJS
Rodrigo Branas
Scope AngularJS
Scope AngularJS
Rodrigo Branas
HTTP Interceptors com AngularJS
HTTP Interceptors com AngularJS
Rodrigo Branas
Criando serviços com AngularJS
Criando serviços com AngularJS
Rodrigo Branas
Criando Filtros com AngularJS
Criando Filtros com AngularJS
Rodrigo Branas
Criando aplicações Single-Page com AngularJS
Criando aplicações Single-Page com AngularJS
Rodrigo Branas
More from Rodrigo Branas
(20)
Clean Architecture
Clean Architecture
Node.js - #7 - Core Modules - http - Parte 1 - Rodrigo Branas
Node.js - #7 - Core Modules - http - Parte 1 - Rodrigo Branas
Node.js - #6 - Core Modules - net - Rodrigo Branas
Node.js - #6 - Core Modules - net - Rodrigo Branas
Node.js - #5 - Process - Rodrigo Branas
Node.js - #5 - Process - Rodrigo Branas
Node.js - #4 - Timers - Rodrigo Branas
Node.js - #4 - Timers - Rodrigo Branas
Node.js - #3 - Global Objects - Rodrigo Branas
Node.js - #3 - Global Objects - Rodrigo Branas
Node.js - #2 - Sistema de Módulos - Rodrigo Branas
Node.js - #2 - Sistema de Módulos - Rodrigo Branas
Node.js - #1 - Introdução - Rodrigo Branas
Node.js - #1 - Introdução - Rodrigo Branas
#6 - Git - Desfazendo as coisas
#6 - Git - Desfazendo as coisas
#1 - Git - Introdução
#1 - Git - Introdução
#4 - Git - Stash
#4 - Git - Stash
A evolução do AngularJS
A evolução do AngularJS
JavaScript - Date
JavaScript - Date
JavaScript - Expressões Regulares
JavaScript - Expressões Regulares
Automação de Testes com AngularJS
Automação de Testes com AngularJS
Scope AngularJS
Scope AngularJS
HTTP Interceptors com AngularJS
HTTP Interceptors com AngularJS
Criando serviços com AngularJS
Criando serviços com AngularJS
Criando Filtros com AngularJS
Criando Filtros com AngularJS
Criando aplicações Single-Page com AngularJS
Criando aplicações Single-Page com AngularJS
Recently uploaded
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Ahmed Mohamed
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
Sujith Sukumaran
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
vaddepallysandeep122
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
confluent
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Philip Schwarz
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
vyaparkranti
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
BrainSell Technologies
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
smiwainfosol
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
31events.com
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
Alina Yurenko
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
preethippts
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
Hanief Utama
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
OnePlan Solutions
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
Christian Birchler
Cyber security and its impact on E commerce
Cyber security and its impact on E commerce
manigoyal112
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Matt Ray
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
Technogeeks
MYjobs Presentation Django-based project
MYjobs Presentation Django-based project
AnoyGreter
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Mater
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Recently uploaded
(20)
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
Cyber security and its impact on E commerce
Cyber security and its impact on E commerce
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
MYjobs Presentation Django-based project
MYjobs Presentation Django-based project
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
#3 - Git - Branching e Merging
1.
Rodrigo Branas –
@rodrigobranas - http://www.agilecode.com.br #3 - Git - Branching e Merging
2.
Rodrigo Branas rodrigo.branas@agilecode.com.br http://www.agilecode.com.br • Arquiteto
de Software na Gennera • Professor na Agile Code • Autor na Java Magazine e PacktPub • Palestrante
3.
http://www.youtube.com/rodrigobranas
4.
O que é
um branch e quais são as vantagens de utilizá-lo?
5.
Um branch é
uma nova linha de desenvolvimento que permite isolar o código de uma nova funcionalidade, mantendo a linha base estável.
6.
É possível trocar
de branch facilmente, a qualquer momento
7.
Os commits podem
continuar contando a história do projeto
8.
O branch pode
ser sincronizado e compartilhado, evitando perdas
9.
Depois de trabalhar
no branch é necessário realizar um merge
10.
git branch
11.
12.
commit a9ae tree f4b3 parent master
13.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae master
14.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d master
15.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master
16.
git branch feature1
17.
18.
git branch
19.
20.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master
21.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1
22.
No Git, um
branch é apenas uma referência para um commit.
23.
cat .git/refs/heads/master cat .git/refs/heads/feature1
24.
25.
git log --oneline
--decorate
26.
27.
HEAD?
28.
cat .git/HEAD
29.
30.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1
31.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1HEAD
32.
git checkout feature1
33.
34.
cat .git/HEAD
35.
36.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1HEAD
37.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1 HEAD
38.
Criando um commit
no branch...
39.
echo d >
d.txt git add -A git commit -m "d.txt"
40.
41.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1 HEAD commit a42c tree ad86 parent b274
42.
git log --oneline
--decorate
43.
44.
Trocando de branch,
os arquivos são substituídos
45.
git checkout master ls
-la
46.
47.
git log --oneline
--decorate
48.
49.
git log --oneline
--decorate --all
50.
51.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1 HEAD commit a42c tree ad86 parent b274
52.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1 commit a42c tree ad86 parent b274 HEAD
53.
Realizando um merge
no master...
54.
git merge feature1
55.
56.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1 commit a42c tree ad86 parent b274 HEAD
57.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1 commit a42c tree ad86 parent b274 HEAD
58.
Fast-Forward
59.
A estratégia fast-forward
é apenas uma atualização da referência e só é possível quando não existe divergência entre os branches.
60.
git log --oneline
--decorate --all
61.
62.
git branch -d
feature1
63.
64.
git log --oneline
--decorate --all
65.
66.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature1 commit a42c tree ad86 parent b274 HEAD
67.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master commit a42c tree ad86 parent b274 HEAD
68.
Criando uma divergência
entre o master e o branch...
69.
git branch feature2 git
checkout feature2 ou git checkout -b feature2
70.
71.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master commit a42c tree ad86 parent b274 HEAD
72.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 HEAD
73.
echo e >
e.txt git add -A git commit -m "e.txt"
74.
75.
git log --oneline
--decorate --all
76.
77.
commit a9ae tree f4b3 parent commit
372d tree d11b parent a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 HEAD
78.
commit 372d tree d11b parent
a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 HEAD
79.
commit 372d tree d11b parent
a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD
80.
git checkout master
81.
82.
commit 372d tree d11b parent
a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD
83.
commit 372d tree d11b parent
a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD
84.
commit 372d tree d11b parent
a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD
85.
echo f >
f.txt git add -A git commit -m "f.txt"
86.
87.
commit 372d tree d11b parent
a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD
88.
commit 372d tree d11b parent
a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c
89.
git log --oneline
--decorate --all
90.
91.
git log --oneline
--decorate --all --graph
92.
93.
Realizando um merge...
94.
git merge feature2
95.
96.
97.
98.
commit 372d tree d11b parent
a9ae commit 7f64 tree 6300 parent 372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c
99.
commit 7f64 tree 6300 parent
372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c
100.
commit 7f64 tree 6300 parent
372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2
101.
Recursive
102.
A estratégia recursive
é utilizada quando existe divergência entre os branches e um commit para unir ambos se torna necessário.
103.
git log --oneline
--decorate --all --graph
104.
105.
git branch -d
feature2
106.
107.
commit 7f64 tree 6300 parent
372d commit b274 tree 15eb parent 7f64 master feature2 commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2
108.
commit 7f64 tree 6300 parent
372d commit b274 tree 15eb parent 7f64 master commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2
109.
E se der
conflito?
110.
git checkout -b
feature3
111.
112.
commit 7f64 tree 6300 parent
372d commit b274 tree 15eb parent 7f64 master commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2
113.
commit 7f64 tree 6300 parent
372d commit b274 tree 15eb parent 7f64 master commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3
114.
echo g2 >
g.txt git add -A git commit -m "g.txt"
115.
116.
commit b274 tree 15eb parent
7f64 master commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3
117.
commit b274 tree 15eb parent
7f64 master commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a
118.
git log --oneline
--decorate --all --graph
119.
120.
git checkout master
121.
122.
commit b274 tree 15eb parent
7f64 master commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c HEAD commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a
123.
commit b274 tree 15eb parent
7f64 master commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a HEAD
124.
echo g1 >
g.txt git add -A git commit -m "g.txt"
125.
126.
commit b274 tree 15eb parent
7f64 master commit a42c tree ad86 parent b274 commit fde2 tree a025 parent a42c commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a HEAD
127.
master commit a42c tree ad86 parent
b274 commit fde2 tree a025 parent a42c commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a HEAD
128.
master commit a42c tree ad86 parent
b274 commit fde2 tree a025 parent a42c commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a HEAD commit c85e tree a1bb parent cc8a
129.
git merge feature3
130.
131.
git status
132.
133.
git diff
134.
135.
vi g.txt
136.
137.
138.
139.
git add -A git
commit -m "g.txt"
140.
141.
master commit a42c tree ad86 parent
b274 commit fde2 tree a025 parent a42c commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a HEAD commit c85e tree a1bb parent cc8a
142.
master commit a42c tree ad86 parent
b274 commit fde2 tree a025 parent a42c commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a HEAD commit c85e tree a1bb parent cc8a commit 270e tree 82b4 parent c85e parent c5b5
143.
git log --oneline
--decorate --all --graph
144.
145.
git branch -d
feature3
146.
147.
master commit a42c tree ad86 parent
b274 commit fde2 tree a025 parent a42c commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 feature3 commit c5b5 tree 82b4 parent cc8a HEAD commit c85e tree a1bb parent cc8a commit 270e tree 82b4 parent c85e parent c5b5
148.
master commit a42c tree ad86 parent
b274 commit fde2 tree a025 parent a42c commit d67a tree 10e6 parent a42c commit cc8a tree 10e6 parent d67a parent fde2 commit c5b5 tree 82b4 parent cc8a HEAD commit c85e tree a1bb parent cc8a commit 270e tree 82b4 parent c85e parent c5b5
149.
Rodrigo Branas Site: http://www.agilecode.com.br Twitter:
@rodrigobranas Facebook: http://www.facebook.com/canalrodrigobranas SlideShare: http://www.slideshare.com/rodrigobranas YouTube: http://www.youtube.com/rodrigobranas LinkedIn: http://br.linkedin.com/in/rodrigobranas +Plus: https://plus.google.com/+RodrigoBranas GitHub: http://www.github.com/rodrigobranas
Download now