Changes between Version 30 and Version 31 of Developer/Git


Ignore:
Timestamp:
Feb 3, 2012, 10:40:49 PM (8 years ago)
Author:
Gedare
Comment:

/* GIT Access for users */

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Git

    v30 v31  
    211211
    212212An alternative to the merge command is rebase, which replays the changes (commits) on one branch onto another. git rebase finds the common ancestor of the two branches, stores each commit of the branch you’re on to temporary files, and applies each commit in order.
     213
     214For example
     215{{{
     216 git checkout branch1
     217 git rebase master
     218}}}
     219or more concisely
     220{{{
     221 git rebase master branch1
     222}}}
     223will bring the changes of master into branch1, and then you can fast-forward master to include branch1 quite easily
     224{{{
     225 git checkout master
     226 git merge branch1
     227}}}
    213228
    214229Rebasing makes a cleaner history than merging; the log of a rebased branch looks like a linear history as if the work was done serially rather than in parallel. A primary reason to rebase is to ensure commits apply cleanly on a remote branch, e.g. when submitting patches to RTEMS that you create by working on a branch in a personal repository. Using rebase to merge your work with the remote branch eliminates most integration work for the committer/maintainer.