Changes between Version 21 and Version 22 of GitForDarcsUsers

Aug 14, 2008 11:52:31 PM (7 years ago)



  • GitForDarcsUsers

    v21 v22  
    3232Note that Git branches all exist in the same repository.  You can have several physical clones of the same repository like in Darcs, but it is often more convenient to work with multiple branches in the same directory.  The most important commands for working with branch are {{{git checkout}}} and {{{git branch}}}, see below. 
     34The typical Git workflow is to use one branch per feature and merge into their original branch once they are considered ready.  For example, if we think ready that "feature1" is ready, we can {{{git merge}}} it into master: 
     36$ git checkout develop   # switch to develop branch 
     37$ git merge feature1     # merge feature1 into current branch 
     39          o---o---o---o---o <-- develop, feature1   
     41o---o---A---o---o---o <-- master 
     43This merge is actually a '''fast-forward''', meaning that no new commit is necessary, since "develop" didn't contain any other changes the pointer for the "develop" branch is merely set to point to the same commit that feature1 pointed to.  On the other hand, if we now merge "devel" into "master" we get a now commit: 
     45$ git checkout master 
     46$ git merge devel 
     47          o---o---o---o---o <-- develop, feature1   
     48         /                 \ 
     49o---o---A---o---o---o-------o <-- master 
     52== Remote Repositories == 
     54XXX: talk about {{{remote/origin/master}}}, {{{fetch}}}, and how it's mostly just already known {{{merge}}} 
     56== Rebase == 
     58First of all, {{{git rebase}}} is a very dangerous feature, ''it should never be done in shared repositories'' (this is like {{{darcs amend-record}}} and {{{darcs unpull}}}, but even harder to fix.) 
     60{{{git rebase}}} is a way to "rewrite history".  (XXX: complete me) 
    3462= General Settings =