Git rebase howto

718 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
718
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Git rebase howto

  1. 1. GiT rebase Explained.. -Mahesh Vaidya mvaidya@awanitech.com +91-9740500144
  2. 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. 3. topic_branch off master branch GiT Rebase master topic_branch
  4. 4. topic_branch and master advanced. (divergence) GiT Rebase master topic_branch C-1
  5. 5. master advanced. (More divergence) GiT Rebase master topic_branch C-1 C-2
  6. 6. Bring changes from master As said earlier no merges please !! Rebase puts changes introduced in C-1 and C-2 respectively to topic_branch. Think of rebase as a cherry-pick over a range of commits. This keeps history linear and less graph traversal cost. Easier history to for human use.
  7. 7. Move topic branch as if it is created off commit C-1 GiT Rebase master topic_branch C-1 C-2
  8. 8. Move topic branch as if it is created off commit C-2 GiT Rebase master topic_branch C-1 C-2
  9. 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. 10. Operational Notes. Stage the merge conflicts: git add <filename> Complete this rebase: git rebase --continue

×