Changes between Version 6 and Version 7 of GitMirror

Show
Ignore:
Timestamp:
02/24/09 18:08:11 (4 years ago)
Author:
pv
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GitMirror

    v6 v7  
    2020= Importing svn meta-data = 
    2121 
    22 Unfortunately, the clone command of git does not copy the svn metadata. To do so, you have to do the following for each clone: 
     22Unfortunately, the clone command of git does not copy the svn metadata by default. To do so, you have to do the following for each clone: 
    2323 
    24 == Add the numpy svn-remote == 
     24== Get the SVN branches == 
     25 
     26Edit .git/config to look something like this: 
     27{{{ 
     28[remote "origin"] 
     29        url = git://github.com/pv/numpy-svn.git 
     30        fetch = +refs/remotes/*:refs/remotes/* 
     31[branch "master"] 
     32        remote = origin 
     33        merge = refs/remotes/trunk 
     34}}} 
     35This ensures that you get the most recent SVN branch pointers when you run ''git fetch''. 
     36 
     37Alternatively, execute the following command to get them only once: 
     38{{{ 
     39git fetch git://github.com/cournape/numpy.git +refs/remotes/*:refs/remotes/* 
     40}}} 
     41This will tell git to download all the svn branch/tags info available on the git mirror just this time. 
     42 
     43== Configure git-svn == 
     44 
     45If you want to commit back to SVN, or to get changes directly from SVN, you need to configure git-svn for the clone: 
    2546 
    2647Edit your .git/config, and add the follwing: 
    27  
    2848{{{ 
    2949[svn-remote "svn"] 
     
    3353        tags = tags/*:refs/remotes/tags/* 
    3454}}} 
     55This tells git-svn where to get svn meta-data. 
    3556 
    36 This tells git-svn where to get svn meta-data 
    37  
    38 == Get the svn metadata == 
    39  
    40 Execute the following command: 
    41  
    42 {{{ 
    43 git fetch git://github.com/cournape/numpy.git +refs/remotes/*:refs/remotes/* 
    44 }}} 
    45  
    46 This will tell git to download all the svn branch/tags info available on the git mirror 
    47  
    48 == Update the svn metadata == 
    49  
    50 To update the svn metadata of say the trunk: 
    51  
     57To update the svn metadata, run: 
    5258{{{ 
    5359git checkout master && git svn rebase -l 
    5460}}} 
     61This should be reasonably fast. 
    5562 
    56 It may take some time the first time. 
    5763 
    58 = Using the git import = 
     64= Using the git clone = 
    5965 
    6066== Create a branch == 
    6167 
    62 There is one rule to always remember: NEVER WORK ON A SVN BRANCH DIRECTLY, ALWAYS ON A BRANCH MADE FROM IT !  
     68There is one rule to always remember: NEVER WORK ON A SVN BRANCH DIRECTLY, ALWAYS ON A BRANCH MADE FROM IT! 
    6369Concretely, if you want to work on the trunk 
    6470 
    6571{{{ 
    66 # Make sure you are on the trunk 
    67 git checkout trunk  
    68 # Make a branch work from trunk 
    69 git branch work 
    70 # Go into the branch 
    71 git checkout work 
     72# Make a branch 'work' based on trunk, and switch to it 
     73git checkout -b work trunk 
    7274}}} 
    7375 
    7476== Committing to svn == 
    7577 
    76 You can commit back to the scipy svn repository with git svn dcommit: 
    77  
     78If you have set up git-svn as instructed above, you can commit back to the scipy svn repository with git svn dcommit: 
    7879{{{ 
    7980git svn dcommit 
     
    8182 
    8283Before actually committing, it is a good idea to check whether you are committing where you think you are committing (with the dry run option of git svn dcommit): 
    83  
    8484{{{ 
    8585git svn dcommit -n 
     
    8989 
    9090Use the rebase command. For example, updating the trunk is a matter of: 
    91  
    9291{{{ 
    9392git checkout trunk