Changes between Version 11 and Version 12 of GitMigrationProposal

Show
Ignore:
Timestamp:
03/15/09 10:15:21 (4 years ago)
Author:
cdavid
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GitMigrationProposal

    v11 v12  
    130130= A first few git specific workflows = 
    131131 
     132Before showing a few simple but powerful git-specific workflows, we need to talk about two features of git. One, branches, is not specific to git, but the index concept is, and a basic understanding is necessary for most git-specific workflows. 
     133 
    132134== The branch concept == 
    133135 
     
    137139 * branches are isolated: if you work on a non trivial feature, having a separate branch means you can commit regularly on it, without pushing things into the "trunk". In particular, you can break things without disturbing anyone else. 
    138140 * branches are a useful unit of decomposition. Although it still certainly makes sense to commit things directly into the main line of development, regularly using separate branches is a good way to split tasks. This is especially useful for reviews: having a separate branch means everyone can easily look at those changes only. The examples will obviously make this clearer. 
     141 
     142== The index and content-oriented tracking == 
     143 
     144In the simple scenarios, we mentioned the '-a' option as necessary to commit all changes. That's because in git, you have to explicitly say which changes you want in a commit. Although a minor inconvenience in simple cases, this is extremely useful in advanced cases, especially for complex merges (to deal with conflict). This is linked to the fundamental idea that git tracks content, and not files. When you do 
     145 
     146{{{ 
     147git add foo.c 
     148}}} 
     149 
     150You are not really adding the file foo.c to the repository, but you add its content to the git repository. 
    139151 
    140152== Scenario 1: creating a new branch == 
     
    155167}}} 
    156168 
    157 Now, every commit will happen in the newbranch. Again, as for commits, the branch is only created in your repository, and not propagated to the repository, unless you explicitly push for it: 
     169Now, every commit will be put in newbranch. Again, as for commits, the branch is only created in your repository, and not propagated to the remote repository, unless you explicitly push for it: 
    158170 
    159171{{{ 
     
    188200Note the difference between '..' and '...'. '..' (2 dots) is the same as a space. 
    189201 
     202== Scenario 3: Merging branches == 
     203 
     204Merging branches is easy: 
     205 
     206{{{ 
     207# Will merge branch1 into the current branch 
     208git merge branch1 
     209}}} 
    190210= Rationale for git =  
    191211