| 1 | First, we need to fetch a copy of the repository. |
| 2 | |
| 3 | {{{ git svn clone -s -r 34140 https://svn.perl.org/parrot # choose some recent-ish commit }}} |
| 4 | |
| 5 | -s is for --stdlayout which presumes the svn recommended layout for tags, trunk, and branches. |
| 6 | |
| 7 | -r is for the revision to start taking history from. If you want to include all of the history, just leave that option off, but it will take a very long time, and you really don't need all of it. You could also ask around for a tarball of the repo with history if you don't want to use the bandwidth and time. |
| 8 | |
| 9 | This will create a directory in the current directory named 'parrot'. If you want to specify the directory to create, pass one more argument. |
| 10 | |
| 11 | Now, start working on patches. The simplest way to work, without local branches, is: |
| 12 | |
| 13 | {{{ |
| 14 | hack; hack; hack; hack |
| 15 | |
| 16 | git diff # look at differences since the last commit |
| 17 | }}} |
| 18 | |
| 19 | If you want to commit all of these changes, run: |
| 20 | {{{ |
| 21 | git commit -a |
| 22 | }}} |
| 23 | and enter your commit message. This creates a local commit only. It hasn't been pushed to the SVN server yet. If you only want to add changes from some files but not others, run: |
| 24 | {{{ |
| 25 | git add file1 file2 file3 ... |
| 26 | git add -i file4 # if you only want to add some diff hunks and not others |
| 27 | git commit |
| 28 | }}} |
| 29 | and enter your commit message. After this, 'git diff' will still show the uncommitted changes. While you're adding changes to be committed, you can run 'git diff --cached' to see what's going to go in the next commit. |
| 30 | |
| 31 | After you've made however many commits, you can push up to the svn server with: |
| 32 | {{{ |
| 33 | git svn dcommit |
| 34 | }}} |
| 35 | That will also bring your local tree up to date. To bring your tree up to date in general, run: |
| 36 | {{{ |
| 37 | git svn rebase |
| 38 | }}} |
| 39 | This will update your local checkout and then re-apply your local un-submitted commits on top of the new trunk. |