SlideShare una empresa de Scribd logo
1 de 10
Descargar para leer sin conexión
GiT rebase Explained..
-Mahesh Vaidya
mvaidya@awanitech.com
+91-9740500144
Purpose: Transplant range of commits
from another branch.
Alternatives: GiT merge
Disadvantage:
● Multi parent commit
● Good SCM policies should
NOT allow merge commit Push
GiT Rebase
topic_branch off master branch
GiT Rebase
master
topic_branch
topic_branch and master advanced.
(divergence)
GiT Rebase
master
topic_branch
C-1
master advanced. (More divergence)
GiT Rebase
master
topic_branch
C-1 C-2
Bring changes from master
As said earlier no merges please !!
option is transplant changes introduced in C-1 and
C-2 respectively.
Think rebase a cherry-pick over a range of
commits.
This keeps history linear and less graph traversal
cost.
Easier history to for human use.
Move topic branch as if it is created off
commit C-1
GiT Rebase
master
topic_branch
C-1 C-2
Move topic branch as if it is created off
commit C-2
GiT Rebase
master
topic_branch
C-1 C-2
Operational Notes.
Same merge conflict reappears:
In git command line use 'git rerere'
to save previous merge decisions.
Want to kill this rebase for now:
git rebase --abort
Operational Notes.
Stage the merge conflicts:
git add <filename>
Complete this rebase:
git rebase --continue

Más contenido relacionado

Similar a Git rebase explained

Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced gitGerrit Wanderer
 
git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)Carlos Duarte do Nascimento
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221Shinho Kang
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through gitMohd Farid
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperJohn Stevenson
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenchesNuno Caneco
 
Git Branching and Merging.pptx
Git Branching and Merging.pptxGit Branching and Merging.pptx
Git Branching and Merging.pptxtapanvyas11
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-itAutomat-IT
 
How to make friends with git
How to make friends with gitHow to make friends with git
How to make friends with gitIlya Vorobiev
 
Git: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best PracticesGit: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best PracticesJeremy Leisy
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for BeginnersNebulaworks
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflowsArthur Shvetsov
 
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization StudioRecent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization StudioIBM Decision Optimization
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-BryanLearningTech
 
Git hub abduallah abu nada
Git hub   abduallah abu nadaGit hub   abduallah abu nada
Git hub abduallah abu nadaLama K Banna
 

Similar a Git rebase explained (20)

Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced git
 
git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)git fail --force (make it up with your pull requests)
git fail --force (make it up with your pull requests)
 
Git tips
Git tipsGit tips
Git tips
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through git
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 
Git basics
Git basicsGit basics
Git basics
 
Git from the trenches
Git from the trenchesGit from the trenches
Git from the trenches
 
Git Branching and Merging.pptx
Git Branching and Merging.pptxGit Branching and Merging.pptx
Git Branching and Merging.pptx
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
How to make friends with git
How to make friends with gitHow to make friends with git
How to make friends with git
 
Git: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best PracticesGit: Overview, Pitfalls, Best Practices
Git: Overview, Pitfalls, Best Practices
 
Trunk based development for Beginners
Trunk based development for BeginnersTrunk based development for Beginners
Trunk based development for Beginners
 
Git commands
Git commandsGit commands
Git commands
 
How to write a git commit message
How to write a git commit messageHow to write a git commit message
How to write a git commit message
 
GIT Rebasing and Merging
GIT Rebasing and MergingGIT Rebasing and Merging
GIT Rebasing and Merging
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization StudioRecent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
Recent MIP Performance Improvements in IBM ILOG CPLEX Optimization Studio
 
Git tutorial git branches 20131206-Bryan
Git tutorial   git branches 20131206-BryanGit tutorial   git branches 20131206-Bryan
Git tutorial git branches 20131206-Bryan
 
Git hub abduallah abu nada
Git hub   abduallah abu nadaGit hub   abduallah abu nada
Git hub abduallah abu nada
 

Último

UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsSafe Software
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 

Último (20)

20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration WorkflowsIgniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 

Git rebase explained

  • 1. GiT rebase Explained.. -Mahesh Vaidya mvaidya@awanitech.com +91-9740500144
  • 2. Purpose: Transplant range of commits from another branch. Alternatives: GiT merge Disadvantage: ● Multi parent commit ● Good SCM policies should NOT allow merge commit Push GiT Rebase
  • 3. topic_branch off master branch GiT Rebase master topic_branch
  • 4. topic_branch and master advanced. (divergence) GiT Rebase master topic_branch C-1
  • 5. master advanced. (More divergence) GiT Rebase master topic_branch C-1 C-2
  • 6. Bring changes from master As said earlier no merges please !! option is transplant changes introduced in C-1 and C-2 respectively. Think rebase a cherry-pick over a range of commits. This keeps history linear and less graph traversal cost. Easier history to for human use.
  • 7. Move topic branch as if it is created off commit C-1 GiT Rebase master topic_branch C-1 C-2
  • 8. Move topic branch as if it is created off commit C-2 GiT Rebase master topic_branch C-1 C-2
  • 9. Operational Notes. Same merge conflict reappears: In git command line use 'git rerere' to save previous merge decisions. Want to kill this rebase for now: git rebase --abort
  • 10. Operational Notes. Stage the merge conflicts: git add <filename> Complete this rebase: git rebase --continue