1GIT-SVN(1) Git Manual GIT-SVN(1)
2
3
4
6 git-svn - Bidirectional operation between a Subversion repository and
7 git
8
10 git svn <command> [options] [arguments]
11
13 git svn is a simple conduit for changesets between Subversion and git.
14 It provides a bidirectional flow of changes between a Subversion and a
15 git repository.
16
17 git svn can track a standard Subversion repository, following the
18 common "trunk/branches/tags" layout, with the --stdlayout option. It
19 can also follow branches and tags in any layout with the -T/-t/-b
20 options (see options to init below, and also the clone command).
21
22 Once tracking a Subversion repository (with any of the above methods),
23 the git repository can be updated from Subversion by the fetch command
24 and Subversion updated from git by the dcommit command.
25
27 init
28 Initializes an empty git repository with additional metadata
29 directories for git svn. The Subversion URL may be specified as a
30 command-line argument, or as full URL arguments to -T/-t/-b.
31 Optionally, the target directory to operate on can be specified as
32 a second argument. Normally this command initializes the current
33 directory.
34
35 -T<trunk_subdir>, --trunk=<trunk_subdir>, -t<tags_subdir>,
36 --tags=<tags_subdir>, -b<branches_subdir>,
37 --branches=<branches_subdir>, -s, --stdlayout
38 These are optional command-line options for init. Each of these
39 flags can point to a relative repository path
40 (--tags=project/tags) or a full url
41 (--tags=https://foo.org/project/tags). You can specify more
42 than one --tags and/or --branches options, in case your
43 Subversion repository places tags or branches under multiple
44 paths. The option --stdlayout is a shorthand way of setting
45 trunk,tags,branches as the relative paths, which is the
46 Subversion default. If any of the other options are given as
47 well, they take precedence.
48
49 --no-metadata
50 Set the noMetadata option in the [svn-remote] config.
51
52 --use-svm-props
53 Set the useSvmProps option in the [svn-remote] config.
54
55 --use-svnsync-props
56 Set the useSvnsyncProps option in the [svn-remote] config.
57
58 --rewrite-root=<URL>
59 Set the rewriteRoot option in the [svn-remote] config.
60
61 --rewrite-uuid=<UUID>
62 Set the rewriteUUID option in the [svn-remote] config.
63
64 --username=<USER>
65 For transports that SVN handles authentication for (http,
66 https, and plain svn), specify the username. For other
67 transports (eg svn+ssh://), you must include the username in
68 the URL, eg svn+ssh://foo@svn.bar.com/project
69
70 --prefix=<prefix>
71 This allows one to specify a prefix which is prepended to the
72 names of remotes if trunk/branches/tags are specified. The
73 prefix does not automatically include a trailing slash, so be
74 sure you include one in the argument if that is what you want.
75 If --branches/-b is specified, the prefix must include a
76 trailing slash. Setting a prefix is useful if you wish to track
77 multiple projects that share a common repository.
78
79 --ignore-paths=<regex>
80 When passed to init or clone this regular expression will be
81 preserved as a config key. See fetch for a description of
82 --ignore-paths.
83
84 --no-minimize-url
85 When tracking multiple directories (using --stdlayout,
86 --branches, or --tags options), git svn will attempt to connect
87 to the root (or highest allowed level) of the Subversion
88 repository. This default allows better tracking of history if
89 entire projects are moved within a repository, but may cause
90 issues on repositories where read access restrictions are in
91 place. Passing --no-minimize-url will allow git svn to accept
92 URLs as-is without attempting to connect to a higher level
93 directory. This option is off by default when only one
94 URL/branch is tracked (it would do little good).
95
96 fetch
97 Fetch unfetched revisions from the Subversion remote we are
98 tracking. The name of the [svn-remote "..."] section in the
99 .git/config file may be specified as an optional command-line
100 argument.
101
102 --localtime
103 Store Git commit times in the local timezone instead of UTC.
104 This makes git log (even without --date=local) show the same
105 times that svn log would in the local timezone.
106
107 This doesn’t interfere with interoperating with the Subversion
108 repository you cloned from, but if you wish for your local Git
109 repository to be able to interoperate with someone else’s local
110 Git repository, either don’t use this option or you should both
111 use it in the same local timezone.
112
113 --parent
114 Fetch only from the SVN parent of the current HEAD.
115
116 --ignore-paths=<regex>
117 This allows one to specify a Perl regular expression that will
118 cause skipping of all matching paths from checkout from SVN.
119 The --ignore-paths option should match for every fetch
120 (including automatic fetches due to clone, dcommit, rebase,
121 etc) on a given repository.
122
123 config key: svn-remote.<name>.ignore-paths
124
125 If the ignore-paths config key is set and the command line
126 option is also given, both regular expressions will be used.
127
128 Examples:
129
130 Skip "doc*" directory for every fetch
131
132 --ignore-paths="^doc"
133
134
135 Skip "branches" and "tags" of first level directories
136
137 --ignore-paths="^[^/]+/(?:branches|tags)"
138
139
140 --use-log-author
141 When retrieving svn commits into git (as part of fetch, rebase,
142 or dcommit operations), look for the first From: or
143 Signed-off-by: line in the log message and use that as the
144 author string.
145
146 --add-author-from
147 When committing to svn from git (as part of commit or dcommit
148 operations), if the existing log message doesn’t already have a
149 From: or Signed-off-by: line, append a From: line based on the
150 git commit’s author string. If you use this, then
151 --use-log-author will retrieve a valid author string for all
152 commits.
153
154 clone
155 Runs init and fetch. It will automatically create a directory based
156 on the basename of the URL passed to it; or if a second argument is
157 passed; it will create a directory and work within that. It accepts
158 all arguments that the init and fetch commands accept; with the
159 exception of --fetch-all and --parent. After a repository is
160 cloned, the fetch command will be able to update revisions without
161 affecting the working tree; and the rebase command will be able to
162 update the working tree with the latest changes.
163
164 rebase
165 This fetches revisions from the SVN parent of the current HEAD and
166 rebases the current (uncommitted to SVN) work against it.
167
168 This works similarly to svn update or git pull except that it
169 preserves linear history with git rebase instead of git merge for
170 ease of dcommitting with git svn.
171
172 This accepts all options that git svn fetch and git rebase accept.
173 However, --fetch-all only fetches from the current [svn-remote],
174 and not all [svn-remote] definitions.
175
176 Like git rebase; this requires that the working tree be clean and
177 have no uncommitted changes.
178
179 -l, --local
180 Do not fetch remotely; only run git rebase against the last
181 fetched commit from the upstream SVN.
182
183 dcommit
184 Commit each diff from a specified head directly to the SVN
185 repository, and then rebase or reset (depending on whether or not
186 there is a diff between SVN and head). This will create a revision
187 in SVN for each commit in git. It is recommended that you run git
188 svn fetch and rebase (not pull or merge) your commits against the
189 latest changes in the SVN repository. An optional revision or
190 branch argument may be specified, and causes git svn to do all work
191 on that revision/branch instead of HEAD. This is advantageous over
192 set-tree (below) because it produces cleaner, more linear history.
193
194 --no-rebase
195 After committing, do not rebase or reset.
196
197 --commit-url <URL>
198 Commit to this SVN URL (the full path). This is intended to
199 allow existing git svn repositories created with one transport
200 method (e.g. svn:// or http:// for anonymous read) to be
201 reused if a user is later given access to an alternate
202 transport method (e.g. svn+ssh:// or https://) for commit.
203
204 config key: svn-remote.<name>.commiturl
205 config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
206
207 Using this option for any other purpose (don’t ask) is very
208 strongly discouraged.
209
210 branch
211 Create a branch in the SVN repository.
212
213 -m, --message
214 Allows to specify the commit message.
215
216 -t, --tag
217 Create a tag by using the tags_subdir instead of the
218 branches_subdir specified during git svn init.
219
220 -d, --destination
221 If more than one --branches (or --tags) option was given to the
222 init or clone command, you must provide the location of the
223 branch (or tag) you wish to create in the SVN repository. The
224 value of this option must match one of the paths specified by a
225 --branches (or --tags) option. You can see these paths with the
226 commands
227
228 git config --get-all svn-remote.<name>.branches
229 git config --get-all svn-remote.<name>.tags
230
231 where <name> is the name of the SVN repository as specified by
232 the -R option to init (or "svn" by default).
233
234 --username
235 Specify the SVN username to perform the commit as. This option
236 overrides configuration property username.
237
238 --commit-url
239 Use the specified URL to connect to the destination Subversion
240 repository. This is useful in cases where the source SVN
241 repository is read-only. This option overrides configuration
242 property commiturl.
243
244 git config --get-all svn-remote.<name>.commiturl
245
246 tag
247 Create a tag in the SVN repository. This is a shorthand for branch
248 -t.
249
250 log
251 This should make it easy to look up svn log messages when svn users
252 refer to -r/--revision numbers.
253
254 The following features from ‘svn log’ are supported:
255
256 -r <n>[:<n>], --revision=<n>[:<n>]
257 is supported, non-numeric args are not: HEAD, NEXT, BASE, PREV,
258 etc ...
259
260 -v, --verbose
261 it’s not completely compatible with the --verbose output in svn
262 log, but reasonably close.
263
264 --limit=<n>
265 is NOT the same as --max-count, doesn’t count merged/excluded
266 commits
267
268 --incremental
269 supported
270
271 New features:
272
273 --show-commit
274 shows the git commit sha1, as well
275
276 --oneline
277 our version of --pretty=oneline
278
279
280 Note
281 SVN itself only stores times in UTC and nothing else. The
282 regular svn client converts the UTC time to the local time (or
283 based on the TZ= environment). This command has the same
284 behaviour.
285 Any other arguments are passed directly to git log
286
287 blame
288 Show what revision and author last modified each line of a file.
289 The output of this mode is format-compatible with the output of
290 ‘svn blame’ by default. Like the SVN blame command, local
291 uncommitted changes in the working copy are ignored; the version of
292 the file in the HEAD revision is annotated. Unknown arguments are
293 passed directly to git blame.
294
295 --git-format
296 Produce output in the same format as git blame, but with SVN
297 revision numbers instead of git commit hashes. In this mode,
298 changes that haven’t been committed to SVN (including local
299 working-copy edits) are shown as revision 0.
300
301 find-rev
302 When given an SVN revision number of the form rN, returns the
303 corresponding git commit hash (this can optionally be followed by a
304 tree-ish to specify which branch should be searched). When given a
305 tree-ish, returns the corresponding SVN revision number.
306
307 set-tree
308 You should consider using dcommit instead of this command. Commit
309 specified commit or tree objects to SVN. This relies on your
310 imported fetch data being up-to-date. This makes absolutely no
311 attempts to do patching when committing to SVN, it simply
312 overwrites files with those specified in the tree or commit. All
313 merging is assumed to have taken place independently of git svn
314 functions.
315
316 create-ignore
317 Recursively finds the svn:ignore property on directories and
318 creates matching .gitignore files. The resulting files are staged
319 to be committed, but are not committed. Use -r/--revision to refer
320 to a specific revision.
321
322 show-ignore
323 Recursively finds and lists the svn:ignore property on directories.
324 The output is suitable for appending to the $GIT_DIR/info/exclude
325 file.
326
327 mkdirs
328 Attempts to recreate empty directories that core git cannot track
329 based on information in $GIT_DIR/svn/<refname>/unhandled.log files.
330 Empty directories are automatically recreated when using "git svn
331 clone" and "git svn rebase", so "mkdirs" is intended for use after
332 commands like "git checkout" or "git reset".
333
334 commit-diff
335 Commits the diff of two tree-ish arguments from the command-line.
336 This command does not rely on being inside an git svn init-ed
337 repository. This command takes three arguments, (a) the original
338 tree to diff against, (b) the new tree result, (c) the URL of the
339 target Subversion repository. The final argument (URL) may be
340 omitted if you are working from a git svn-aware repository (that
341 has been init-ed with git svn). The -r<revision> option is required
342 for this.
343
344 info
345 Shows information about a file or directory similar to what ‘svn
346 info’ provides. Does not currently support a -r/--revision
347 argument. Use the --url option to output only the value of the URL:
348 field.
349
350 proplist
351 Lists the properties stored in the Subversion repository about a
352 given file or directory. Use -r/--revision to refer to a specific
353 Subversion revision.
354
355 propget
356 Gets the Subversion property given as the first argument, for a
357 file. A specific revision can be specified with -r/--revision.
358
359 show-externals
360 Shows the Subversion externals. Use -r/--revision to specify a
361 specific revision.
362
363 gc
364 Compress $GIT_DIR/svn/<refname>/unhandled.log files in .git/svn and
365 remove $GIT_DIR/svn/<refname>index files in .git/svn.
366
367 reset
368 Undoes the effects of fetch back to the specified revision. This
369 allows you to re-fetch an SVN revision. Normally the contents of an
370 SVN revision should never change and reset should not be necessary.
371 However, if SVN permissions change, or if you alter your
372 --ignore-paths option, a fetch may fail with "not found in commit"
373 (file not previously visible) or "checksum mismatch" (missed a
374 modification). If the problem file cannot be ignored forever (with
375 --ignore-paths) the only way to repair the repo is to use reset.
376
377 Only the rev_map and refs/remotes/git-svn are changed. Follow reset
378 with a fetch and then git reset or git rebase to move local
379 branches onto the new tree.
380
381 -r <n>, --revision=<n>
382 Specify the most recent revision to keep. All later revisions
383 are discarded.
384
385 -p, --parent
386 Discard the specified revision as well, keeping the nearest
387 parent instead.
388
389 Example:
390 Assume you have local changes in "master", but you need to
391 refetch "r2".
392
393 r1---r2---r3 remotes/git-svn
394 \
395 A---B master
396
397 Fix the ignore-paths or SVN permissions problem that caused
398 "r2" to be incomplete in the first place. Then:
399
400 git svn reset -r2 -p
401 git svn fetch
402
403
404
405 r1---r2´--r3´ remotes/git-svn
406 \
407 r2---r3---A---B master
408
409 Then fixup "master" with git rebase. Do NOT use git merge or
410 your history will not be compatible with a future dcommit!
411
412 git rebase --onto remotes/git-svn A^ master
413
414
415
416 r1---r2´--r3´ remotes/git-svn
417 \
418 A´--B´ master
419
420
422 --shared[={false|true|umask|group|all|world|everybody}],
423 --template=<template_directory>
424 Only used with the init command. These are passed directly to git
425 init.
426
427 -r <ARG>, --revision <ARG>
428 Used with the fetch command.
429
430 This allows revision ranges for partial/cauterized history to be
431 supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
432 $NUMBER:HEAD, and BASE:$NUMBER are all supported.
433
434 This can allow you to make partial mirrors when running fetch; but
435 is generally not recommended because history will be skipped and
436 lost.
437
438 -, --stdin
439 Only used with the set-tree command.
440
441 Read a list of commits from stdin and commit them in reverse order.
442 Only the leading sha1 is read from each line, so git rev-list
443 --pretty=oneline output can be used.
444
445 --rmdir
446 Only used with the dcommit, set-tree and commit-diff commands.
447
448 Remove directories from the SVN tree if there are no files left
449 behind. SVN can version empty directories, and they are not removed
450 by default if there are no files left in them. git cannot version
451 empty directories. Enabling this flag will make the commit to SVN
452 act like git.
453
454 config key: svn.rmdir
455
456
457 -e, --edit
458 Only used with the dcommit, set-tree and commit-diff commands.
459
460 Edit the commit message before committing to SVN. This is off by
461 default for objects that are commits, and forced on when committing
462 tree objects.
463
464 config key: svn.edit
465
466
467 -l<num>, --find-copies-harder
468 Only used with the dcommit, set-tree and commit-diff commands.
469
470 They are both passed directly to git diff-tree; see git-diff-
471 tree(1) for more information.
472
473 config key: svn.l
474 config key: svn.findcopiesharder
475
476
477 -A<filename>, --authors-file=<filename>
478 Syntax is compatible with the file used by git cvsimport:
479
480 loginname = Joe User <user@example.com>
481
482 If this option is specified and git svn encounters an SVN committer
483 name that does not exist in the authors-file, git svn will abort
484 operation. The user will then have to add the appropriate entry.
485 Re-running the previous git svn command after the authors-file is
486 modified should continue operation.
487
488 config key: svn.authorsfile
489
490
491 --authors-prog=<filename>
492 If this option is specified, for each SVN committer name that does
493 not exist in the authors file, the given file is executed with the
494 committer name as the first argument. The program is expected to
495 return a single line of the form "Name <email>", which will be
496 treated as if included in the authors file.
497
498 -q, --quiet
499 Make git svn less verbose. Specify a second time to make it even
500 less verbose.
501
502 --repack[=<n>], --repack-flags=<flags>
503 These should help keep disk usage sane for large fetches with many
504 revisions.
505
506 --repack takes an optional argument for the number of revisions to
507 fetch before repacking. This defaults to repacking every 1000
508 commits fetched if no argument is specified.
509
510 --repack-flags are passed directly to git repack.
511
512 config key: svn.repack
513 config key: svn.repackflags
514
515
516 -m, --merge, -s<strategy>, --strategy=<strategy>
517 These are only used with the dcommit and rebase commands.
518
519 Passed directly to git rebase when using dcommit if a git reset
520 cannot be used (see dcommit).
521
522 -n, --dry-run
523 This can be used with the dcommit, rebase, branch and tag commands.
524
525 For dcommit, print out the series of git arguments that would show
526 which diffs would be committed to SVN.
527
528 For rebase, display the local branch associated with the upstream
529 svn repository associated with the current branch and the URL of
530 svn repository that will be fetched from.
531
532 For branch and tag, display the urls that will be used for copying
533 when creating the branch or tag.
534
536 -i<GIT_SVN_ID>, --id <GIT_SVN_ID>
537 This sets GIT_SVN_ID (instead of using the environment). This
538 allows the user to override the default refname to fetch from when
539 tracking a single URL. The log and dcommit commands no longer
540 require this switch as an argument.
541
542 -R<remote name>, --svn-remote <remote name>
543 Specify the [svn-remote "<remote name>"] section to use, this
544 allows SVN multiple repositories to be tracked. Default: "svn"
545
546 --follow-parent
547 This is especially helpful when we’re tracking a directory that has
548 been moved around within the repository, or if we started tracking
549 a branch and never tracked the trunk it was descended from. This
550 feature is enabled by default, use --no-follow-parent to disable
551 it.
552
553 config key: svn.followparent
554
555
557 svn.noMetadata, svn-remote.<name>.noMetadata
558 This gets rid of the git-svn-id: lines at the end of every commit.
559
560 If you lose your .git/svn/git-svn/.rev_db file, git svn will not be
561 able to rebuild it and you won’t be able to fetch again, either.
562 This is fine for one-shot imports.
563
564 The git svn log command will not work on repositories using this,
565 either. Using this conflicts with the useSvmProps option for
566 (hopefully) obvious reasons.
567
568 svn.useSvmProps, svn-remote.<name>.useSvmProps
569 This allows git svn to re-map repository URLs and UUIDs from
570 mirrors created using SVN::Mirror (or svk) for metadata.
571
572 If an SVN revision has a property, "svm:headrev", it is likely that
573 the revision was created by SVN::Mirror (also used by SVK). The
574 property contains a repository UUID and a revision. We want to make
575 it look like we are mirroring the original URL, so introduce a
576 helper function that returns the original identity URL and UUID,
577 and use it when generating metadata in commit messages.
578
579 svn.useSvnsyncProps, svn-remote.<name>.useSvnsyncprops
580 Similar to the useSvmProps option; this is for users of the
581 svnsync(1) command distributed with SVN 1.4.x and later.
582
583 svn-remote.<name>.rewriteRoot
584 This allows users to create repositories from alternate URLs. For
585 example, an administrator could run git svn on the server locally
586 (accessing via file://) but wish to distribute the repository with
587 a public http:// or svn:// URL in the metadata so users of it will
588 see the public URL.
589
590 svn-remote.<name>.rewriteUUID
591 Similar to the useSvmProps option; this is for users who need to
592 remap the UUID manually. This may be useful in situations where the
593 original UUID is not available via either useSvmProps or
594 useSvnsyncProps.
595
596 svn.brokenSymlinkWorkaround
597 This disables potentially expensive checks to workaround broken
598 symlinks checked into SVN by broken clients. Set this option to
599 "false" if you track a SVN repository with many empty blobs that
600 are not symlinks. This option may be changed while git svn is
601 running and take effect on the next revision fetched. If unset, git
602 svn assumes this option to be "true".
603
604 Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and
605 useSvmProps options all affect the metadata generated and used by git
606 svn; they must be set in the configuration file before any history is
607 imported and these settings should never be changed once they are set.
608
609 Additionally, only one of these options can be used per svn-remote
610 section because they affect the git-svn-id: metadata line, except for
611 rewriteRoot and rewriteUUID which can be used together.
612
614 Tracking and contributing to the trunk of a Subversion-managed project:
615
616 # Clone a repo (like git clone):
617 git svn clone http://svn.example.com/project/trunk
618 # Enter the newly cloned directory:
619 cd trunk
620 # You should be on master branch, double-check with ´git branch´
621 git branch
622 # Do some work and commit locally to git:
623 git commit ...
624 # Something is committed to SVN, rebase your local changes against the
625 # latest changes in SVN:
626 git svn rebase
627 # Now commit your changes (that were committed previously using git) to SVN,
628 # as well as automatically updating your working HEAD:
629 git svn dcommit
630 # Append svn:ignore settings to the default git exclude file:
631 git svn show-ignore >> .git/info/exclude
632
633
634 Tracking and contributing to an entire Subversion-managed project
635 (complete with a trunk, tags and branches):
636
637 # Clone a repo (like git clone):
638 git svn clone http://svn.example.com/project -T trunk -b branches -t tags
639 # View all branches and tags you have cloned:
640 git branch -r
641 # Create a new branch in SVN
642 git svn branch waldo
643 # Reset your master to trunk (or any other branch, replacing ´trunk´
644 # with the appropriate name):
645 git reset --hard remotes/trunk
646 # You may only dcommit to one branch/tag/trunk at a time. The usage
647 # of dcommit/rebase/show-ignore should be the same as above.
648
649
650 The initial git svn clone can be quite time-consuming (especially for
651 large Subversion repositories). If multiple people (or one person with
652 multiple machines) want to use git svn to interact with the same
653 Subversion repository, you can do the initial git svn clone to a
654 repository on a server and have each person clone that repository with
655 git clone:
656
657 # Do the initial import on a server
658 ssh server "cd /pub && git svn clone http://svn.example.com/project
659 # Clone locally - make sure the refs/remotes/ space matches the server
660 mkdir project
661 cd project
662 git init
663 git remote add origin server:/pub/project
664 git config --add remote.origin.fetch ´+refs/remotes/*:refs/remotes/*´
665 git fetch
666 # Create a local branch from one of the branches just fetched
667 git checkout -b master FETCH_HEAD
668 # Initialize ´git svn´ locally (be sure to use the same URL and -T/-b/-t options as were used on server)
669 git svn init http://svn.example.com/project
670 # Pull the latest changes from Subversion
671 git svn rebase
672
673
675 Originally, git svn recommended that the remotes/git-svn branch be
676 pulled or merged from. This is because the author favored git svn
677 set-tree B to commit a single head rather than the git svn set-tree
678 A..B notation to commit multiple commits.
679
680 If you use git svn set-tree A..B to commit several diffs and you do not
681 have the latest remotes/git-svn merged into my-branch, you should use
682 git svn rebase to update your work branch instead of git pull or git
683 merge. pull/merge can cause non-linear history to be flattened when
684 committing into SVN, which can lead to merge commits reversing previous
685 commits in SVN.
686
688 Merge tracking in Subversion is lacking and doing branched development
689 with Subversion can be cumbersome as a result. While git svn can track
690 copy history (including branches and tags) for repositories adopting a
691 standard layout, it cannot yet represent merge history that happened
692 inside git back upstream to SVN users. Therefore it is advised that
693 users keep history as linear as possible inside git to ease
694 compatibility with SVN (see the CAVEATS section below).
695
697 For the sake of simplicity and interoperating with a less-capable
698 system (SVN), it is recommended that all git svn users clone, fetch and
699 dcommit directly from the SVN server, and avoid all git
700 clone/pull/merge/push operations between git repositories and branches.
701 The recommended method of exchanging code between git branches and
702 users is git format-patch and git am, or just ´dcommit’ing to the SVN
703 repository.
704
705 Running git merge or git pull is NOT recommended on a branch you plan
706 to dcommit from. Subversion does not represent merges in any reasonable
707 or useful fashion; so users using Subversion cannot see any merges
708 you’ve made. Furthermore, if you merge or pull from a git branch that
709 is a mirror of an SVN branch, dcommit may commit to the wrong branch.
710
711 If you do merge, note the following rule: git svn dcommit will attempt
712 to commit on top of the SVN commit named in
713
714 git log --grep=^git-svn-id: --first-parent -1
715
716
717 You must therefore ensure that the most recent commit of the branch you
718 want to dcommit to is the first parent of the merge. Chaos will ensue
719 otherwise, especially if the first parent is an older commit on the
720 same SVN branch.
721
722 git clone does not clone branches under the refs/remotes/ hierarchy or
723 any git svn metadata, or config. So repositories created and managed
724 with using git svn should use rsync for cloning, if cloning is to be
725 done at all.
726
727 Since dcommit uses rebase internally, any git branches you git push to
728 before dcommit on will require forcing an overwrite of the existing ref
729 on the remote repository. This is generally considered bad practice,
730 see the git-push(1) documentation for details.
731
732 Do not use the --amend option of git-commit(1) on a change you’ve
733 already dcommitted. It is considered bad practice to --amend commits
734 you’ve already pushed to a remote repository for other users, and
735 dcommit with SVN is analogous to that.
736
737 When using multiple --branches or --tags, git svn does not
738 automatically handle name collisions (for example, if two branches from
739 different paths have the same name, or if a branch and a tag have the
740 same name). In these cases, use init to set up your git repository
741 then, before your first fetch, edit the .git/config file so that the
742 branches and tags are associated with different name spaces. For
743 example:
744
745 branches = stable/*:refs/remotes/svn/stable/*
746 branches = debug/*:refs/remotes/svn/debug/*
747
749 We ignore all SVN properties except svn:executable. Any unhandled
750 properties are logged to $GIT_DIR/svn/<refname>/unhandled.log
751
752 Renamed and copied directories are not detected by git and hence not
753 tracked when committing to SVN. I do not plan on adding support for
754 this as it’s quite difficult and time-consuming to get working for all
755 the possible corner cases (git doesn’t do it, either). Committing
756 renamed and copied files are fully supported if they’re similar enough
757 for git to detect them.
758
760 git svn stores [svn-remote] configuration information in the repository
761 .git/config file. It is similar the core git [remote] sections except
762 fetch keys do not accept glob arguments; but they are instead handled
763 by the branches and tags keys. Since some SVN repositories are oddly
764 configured with multiple projects glob expansions such those listed
765 below are allowed:
766
767 [svn-remote "project-a"]
768 url = http://server.org/svn
769 fetch = trunk/project-a:refs/remotes/project-a/trunk
770 branches = branches/*/project-a:refs/remotes/project-a/branches/*
771 tags = tags/*/project-a:refs/remotes/project-a/tags/*
772
773
774 Keep in mind that the * (asterisk) wildcard of the local ref (right of
775 the :) must be the farthest right path component; however the remote
776 wildcard may be anywhere as long as it’s an independent path component
777 (surrounded by / or EOL). This type of configuration is not
778 automatically created by init and should be manually entered with a
779 text-editor or using git config.
780
781 It is also possible to fetch a subset of branches or tags by using a
782 comma-separated list of names within braces. For example:
783
784 [svn-remote "huge-project"]
785 url = http://server.org/svn
786 fetch = trunk/src:refs/remotes/trunk
787 branches = branches/{red,green}/src:refs/remotes/branches/*
788 tags = tags/{1.0,2.0}/src:refs/remotes/tags/*
789
790
791 Note that git-svn keeps track of the highest revision in which a branch
792 or tag has appeared. If the subset of branches or tags is changed after
793 fetching, then .git/svn/.metadata must be manually edited to remove (or
794 reset) branches-maxRev and/or tags-maxRev as appropriate.
795
797 git-rebase(1)
798
800 Written by Eric Wong <normalperson@yhbt.net[1]>.
801
803 Written by Eric Wong <normalperson@yhbt.net[1]>.
804
806 1. normalperson@yhbt.net
807 mailto:normalperson@yhbt.net
808
809
810
811Git 1.7.1 08/16/2017 GIT-SVN(1)