Changes between Version 6 and Version 7 of GitMirror
- Timestamp:
- 02/24/09 18:08:11 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GitMirror
v6 v7 20 20 = Importing svn meta-data = 21 21 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:22 Unfortunately, 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: 23 23 24 == Add the numpy svn-remote == 24 == Get the SVN branches == 25 26 Edit .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 }}} 35 This ensures that you get the most recent SVN branch pointers when you run ''git fetch''. 36 37 Alternatively, execute the following command to get them only once: 38 {{{ 39 git fetch git://github.com/cournape/numpy.git +refs/remotes/*:refs/remotes/* 40 }}} 41 This 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 45 If you want to commit back to SVN, or to get changes directly from SVN, you need to configure git-svn for the clone: 25 46 26 47 Edit your .git/config, and add the follwing: 27 28 48 {{{ 29 49 [svn-remote "svn"] … … 33 53 tags = tags/*:refs/remotes/tags/* 34 54 }}} 55 This tells git-svn where to get svn meta-data. 35 56 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 57 To update the svn metadata, run: 52 58 {{{ 53 59 git checkout master && git svn rebase -l 54 60 }}} 61 This should be reasonably fast. 55 62 56 It may take some time the first time.57 63 58 = Using the git import=64 = Using the git clone = 59 65 60 66 == Create a branch == 61 67 62 There is one rule to always remember: NEVER WORK ON A SVN BRANCH DIRECTLY, ALWAYS ON A BRANCH MADE FROM IT !68 There is one rule to always remember: NEVER WORK ON A SVN BRANCH DIRECTLY, ALWAYS ON A BRANCH MADE FROM IT! 63 69 Concretely, if you want to work on the trunk 64 70 65 71 {{{ 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 73 git checkout -b work trunk 72 74 }}} 73 75 74 76 == Committing to svn == 75 77 76 You can commit back to the scipy svn repository with git svn dcommit: 77 78 If you have set up git-svn as instructed above, you can commit back to the scipy svn repository with git svn dcommit: 78 79 {{{ 79 80 git svn dcommit … … 81 82 82 83 Before 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 84 84 {{{ 85 85 git svn dcommit -n … … 89 89 90 90 Use the rebase command. For example, updating the trunk is a matter of: 91 92 91 {{{ 93 92 git checkout trunk
