Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Presentation of the new
GIT REBASE
workflow in eXo
Copyright 2014 eXo Platform
Why in eXo we stop using GIT MERGE and
start using GIT REBASE to integrate change
from one branch to another
Copyright 201...
A presentation
by Trong from Portal Team
Copyright 2014 eXo Platform
Agenda
Copyright 2014 eXo Platform
Enjoy...
1. Git Merge Process
2. Git Rebase Introduction
3. Rebase - the new eXo Workfl...
In eXo we used the
GIT MERGE
method until today
Copyright 2014 eXo Platform
Process used today
● Using GIT-Merge for integrating changes between
branches
● Many feature branches are in progress in p...
Consequences
Wonderful???
Copyright 2014 eXo Platform
Amazing
graph of
commits
history
Consequences
Copyright 2014 eXo Platform
Copyright 2014 eXo Platform
Drawbacks
● Commit history is unusable for commit tracker
● Be off the track of Feature Branch development
● Potentially h...
An introduction to the powerful
GIT REBASE
method to integrate change
Copyright 2014 eXo Platform
Introduction
● Another way (beside Merge) to integrate changes
from one branch to another
● Take all the changes (commits)...
Introduction
● Powerful tool to clean-up/re-organize commit
history
● A fast-forward merge to the branch you are rebasing
...
How it works basically
Let’s say we have:
C1---C2---C6---C7 (master)

C3---C4---C5 (feature branch)
After rebase:
C1---C2-...
How smart
Let’s say C4 and C6 are exactly the same patch, like below:
C1---C2---C6---C7 (master)

C3---C4---C5 (stabilizat...
Instantiate the new
WORKFLOW
using Git Rebase
Copyright 2014 eXo Platform
Common rules
● Never push --force in master
● Push --force is only allowed in FBs
● Be careful before pushing with --force...
Feature branch
Create a feature branch (FB) from master
C1---C2 (master)

C3 (FB)
with C3 is the POMs version update commi...
Feature branch
After a long while, the history looks like:
C1---C2---C6---C7 (master)

C3---C4---C5 (feature branch)
Integ...
Feature branch
Merge to master with non-fast-forward :
C1---C2---C6---C7-----------------C8 (master)
 /
C3’---C4’---C5’ (f...
Good Practices
● Squash related commits before merging
● Plan to sync with master as frequently as possible
(jenkin jobs ?...
It’s time to
MIGRATE
from merge to rebase
Copyright 2014 eXo Platform
Transition - Migration
● Start using rebase for new feature branch
● If possible, convert to use rebase on existing featur...
You are interesting to
LEARN MORE
about our Git Workflow in eXo ?
Copyright 2014 eXo Platform
http://developer.exoplatform...
Upcoming SlideShare
Loading in …5
×

eXoer on the grill: New Git Rebase Workflow

20,659 views

Published on

www.exoplatform.com - Why at eXo we stop using Git Merge and start using Git Rebase to integrate change from one branch to another.
By Trong from eXo Portal Team

eXoers on the Grill aims to provide some incentive & fresh air for our staff in order to constantly re-think our methods, spread good practices, promote some technology or tools, generate ideas, etc... All the teams are invited to contribute by picking up some hot topics of their choice and spread to other teams.

Published in: Technology
  • Sex in your area is here: ❤❤❤ http://bit.ly/2F4cEJi ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating direct: ♥♥♥ http://bit.ly/2F4cEJi ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

eXoer on the grill: New Git Rebase Workflow

  1. 1. Presentation of the new GIT REBASE workflow in eXo Copyright 2014 eXo Platform
  2. 2. Why in eXo we stop using GIT MERGE and start using GIT REBASE to integrate change from one branch to another Copyright 2014 eXo Platform
  3. 3. A presentation by Trong from Portal Team Copyright 2014 eXo Platform
  4. 4. Agenda Copyright 2014 eXo Platform Enjoy... 1. Git Merge Process 2. Git Rebase Introduction 3. Rebase - the new eXo Workflow 4. Transition/Migration from Merge to Rebase
  5. 5. In eXo we used the GIT MERGE method until today Copyright 2014 eXo Platform
  6. 6. Process used today ● Using GIT-Merge for integrating changes between branches ● Many feature branches are in progress in parallels ● Merge/Sync feature branches with master frequently, every week(s) regularly Copyright 2014 eXo Platform
  7. 7. Consequences Wonderful??? Copyright 2014 eXo Platform
  8. 8. Amazing graph of commits history Consequences Copyright 2014 eXo Platform
  9. 9. Copyright 2014 eXo Platform
  10. 10. Drawbacks ● Commit history is unusable for commit tracker ● Be off the track of Feature Branch development ● Potentially have to reset useless changes ● Don’t have a clear context when resolving conflicts -> easy to make mistakes. Copyright 2014 eXo Platform
  11. 11. An introduction to the powerful GIT REBASE method to integrate change Copyright 2014 eXo Platform
  12. 12. Introduction ● Another way (beside Merge) to integrate changes from one branch to another ● Take all the changes (commits) that were committed on one branch and replay them on another one, one by one in turn. Copyright 2014 eXo Platform
  13. 13. Introduction ● Powerful tool to clean-up/re-organize commit history ● A fast-forward merge to the branch you are rebasing onto. Copyright 2014 eXo Platform
  14. 14. How it works basically Let’s say we have: C1---C2---C6---C7 (master) C3---C4---C5 (feature branch) After rebase: C1---C2---C6---C7 (master) C3’---C4’---C5’ (feature branch) Copyright 2014 eXo Platform
  15. 15. How smart Let’s say C4 and C6 are exactly the same patch, like below: C1---C2---C6---C7 (master) C3---C4---C5 (stabilization) After rebase: C1---C2---C6---C7 (master) C3’---C5’ (stabilization) Copyright 2014 eXo Platform
  16. 16. Instantiate the new WORKFLOW using Git Rebase Copyright 2014 eXo Platform
  17. 17. Common rules ● Never push --force in master ● Push --force is only allowed in FBs ● Be careful before pushing with --force Copyright 2014 eXo Platform
  18. 18. Feature branch Create a feature branch (FB) from master C1---C2 (master) C3 (FB) with C3 is the POMs version update commit Copyright 2014 eXo Platform
  19. 19. Feature branch After a long while, the history looks like: C1---C2---C6---C7 (master) C3---C4---C5 (feature branch) Integrate changes from master with rebase: C1---C2---C6---C7 (master) C3’---C4’---C5’ (feature branch) Copyright 2014 eXo Platform
  20. 20. Feature branch Merge to master with non-fast-forward : C1---C2---C6---C7-----------------C8 (master) / C3’---C4’---C5’ (feature branch) Merge to master with fast-forward : C1---C2---C6---C7---C4’---C5’ (master) C4’---C5’ (feature branch) Copyright 2014 eXo Platform
  21. 21. Good Practices ● Squash related commits before merging ● Plan to sync with master as frequently as possible (jenkin jobs ?) Copyright 2014 eXo Platform
  22. 22. It’s time to MIGRATE from merge to rebase Copyright 2014 eXo Platform
  23. 23. Transition - Migration ● Start using rebase for new feature branch ● If possible, convert to use rebase on existing feature branches ● Use rebase for auto-merge Jenkins jobs, such as translation injection, etc. ??? ● PORTAL team can be in charge of the migration Copyright 2014 eXo Platform
  24. 24. You are interesting to LEARN MORE about our Git Workflow in eXo ? Copyright 2014 eXo Platform http://developer.exoplatform.org/docs/scm/git/workflow/

×