@@ -3,7 +3,7 @@ git-svn(1)
3
3
4
4
NAME
5
5
----
6
- git-svn - Bidirectional operation between a single Subversion branch and git
6
+ git-svn - Bidirectional operation between a Subversion repository and git
7
7
8
8
SYNOPSIS
9
9
--------
@@ -15,13 +15,12 @@ DESCRIPTION
15
15
It provides a bidirectional flow of changes between a Subversion and a git
16
16
repository.
17
17
18
- 'git-svn' can track a single Subversion branch simply by using a
19
- URL to the branch, follow branches laid out in the Subversion recommended
20
- method (trunk, branches, tags directories) with the --stdlayout option, or
21
- follow branches in any layout with the -T/-t/-b options (see options to
22
- 'init' below, and also the 'clone' command).
18
+ 'git-svn' can track a standard Subversion repository,
19
+ following the common "trunk/branches/tags" layout, with the --stdlayout option.
20
+ It can also follow branches and tags in any layout with the -T/-t/-b options
21
+ (see options to 'init' below, and also the 'clone' command).
23
22
24
- Once tracking a Subversion branch (with any of the above methods), the git
23
+ Once tracking a Subversion repository (with any of the above methods), the git
25
24
repository can be updated from Subversion by the 'fetch' command and
26
25
Subversion updated from git by the 'dcommit' command.
27
26
@@ -48,8 +47,11 @@ COMMANDS
48
47
--stdlayout;;
49
48
These are optional command-line options for init. Each of
50
49
these flags can point to a relative repository path
51
- (--tags=project/tags') or a full url
52
- (--tags=https://foo.org/project/tags). The option --stdlayout is
50
+ (--tags=project/tags) or a full url
51
+ (--tags=https://foo.org/project/tags).
52
+ You can specify more than one --tags and/or --branches options, in case
53
+ your Subversion repository places tags or branches under multiple paths.
54
+ The option --stdlayout is
53
55
a shorthand way of setting trunk,tags,branches as the relative paths,
54
56
which is the Subversion default. If any of the other options are given
55
57
as well, they take precedence.
@@ -170,8 +172,9 @@ and have no uncommitted changes.
170
172
It is recommended that you run 'git-svn' fetch and rebase (not
171
173
pull or merge) your commits against the latest changes in the
172
174
SVN repository.
173
- An optional command-line argument may be specified as an
174
- alternative to HEAD.
175
+ An optional revision or branch argument may be specified, and
176
+ causes 'git-svn' to do all work on that revision/branch
177
+ instead of HEAD.
175
178
This is advantageous over 'set-tree' (below) because it produces
176
179
cleaner, more linear history.
177
180
+
@@ -204,6 +207,20 @@ config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
204
207
Create a tag by using the tags_subdir instead of the branches_subdir
205
208
specified during git svn init.
206
209
210
+ -d;;
211
+ --destination;;
212
+ If more than one --branches (or --tags) option was given to the 'init'
213
+ or 'clone' command, you must provide the location of the branch (or
214
+ tag) you wish to create in the SVN repository. The value of this
215
+ option must match one of the paths specified by a --branches (or
216
+ --tags) option. You can see these paths with the commands
217
+ +
218
+ git config --get-all svn-remote.<name>.branches
219
+ git config --get-all svn-remote.<name>.tags
220
+ +
221
+ where <name> is the name of the SVN repository as specified by the -R option to
222
+ 'init' (or "svn" by default).
223
+
207
224
'tag'::
208
225
Create a tag in the SVN repository. This is a shorthand for
209
226
'branch -t'.
@@ -215,7 +232,7 @@ config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
215
232
The following features from `svn log' are supported:
216
233
+
217
234
--
218
- --revision=<n>[:<n>];;
235
+ -r/- -revision=<n>[:<n>];;
219
236
is supported, non-numeric args are not:
220
237
HEAD, NEXT, BASE, PREV, etc ...
221
238
-v/--verbose;;
@@ -313,6 +330,63 @@ Any other arguments are passed directly to 'git-log'
313
330
Shows the Subversion externals. Use -r/--revision to specify a
314
331
specific revision.
315
332
333
+ 'reset'::
334
+ Undoes the effects of 'fetch' back to the specified revision.
335
+ This allows you to re-'fetch' an SVN revision. Normally the
336
+ contents of an SVN revision should never change and 'reset'
337
+ should not be necessary. However, if SVN permissions change,
338
+ or if you alter your --ignore-paths option, a 'fetch' may fail
339
+ with "not found in commit" (file not previously visible) or
340
+ "checksum mismatch" (missed a modification). If the problem
341
+ file cannot be ignored forever (with --ignore-paths) the only
342
+ way to repair the repo is to use 'reset'.
343
+
344
+ Only the rev_map and refs/remotes/git-svn are changed. Follow 'reset'
345
+ with a 'fetch' and then 'git-reset' or 'git-rebase' to move local
346
+ branches onto the new tree.
347
+
348
+ -r/--revision=<n>;;
349
+ Specify the most recent revision to keep. All later revisions
350
+ are discarded.
351
+ -p/--parent;;
352
+ Discard the specified revision as well, keeping the nearest
353
+ parent instead.
354
+ Example:;;
355
+ Assume you have local changes in "master", but you need to refetch "r2".
356
+
357
+ ------------
358
+ r1---r2---r3 remotes/git-svn
359
+ \
360
+ A---B master
361
+ ------------
362
+
363
+ Fix the ignore-paths or SVN permissions problem that caused "r2" to
364
+ be incomplete in the first place. Then:
365
+
366
+ [verse]
367
+ git svn reset -r2 -p
368
+ git svn fetch
369
+
370
+ ------------
371
+ r1---r2'--r3' remotes/git-svn
372
+ \
373
+ r2---r3---A---B master
374
+ ------------
375
+
376
+ Then fixup "master" with 'git-rebase'.
377
+ Do NOT use 'git-merge' or your history will not be compatible with a
378
+ future 'dcommit'!
379
+
380
+ [verse]
381
+ git rebase --onto remotes/git-svn A^ master
382
+
383
+ ------------
384
+ r1---r2'--r3' remotes/git-svn
385
+ \
386
+ A'--B' master
387
+ ------------
388
+
389
+
316
390
--
317
391
318
392
OPTIONS
@@ -669,6 +743,16 @@ already dcommitted. It is considered bad practice to --amend commits
669
743
you've already pushed to a remote repository for other users, and
670
744
dcommit with SVN is analogous to that.
671
745
746
+ When using multiple --branches or --tags, 'git-svn' does not automatically
747
+ handle name collisions (for example, if two branches from different paths have
748
+ the same name, or if a branch and a tag have the same name). In these cases,
749
+ use 'init' to set up your git repository then, before your first 'fetch', edit
750
+ the .git/config file so that the branches and tags are associated with
751
+ different name spaces. For example:
752
+
753
+ branches = stable/*:refs/remotes/svn/stable/*
754
+ branches = debug/*:refs/remotes/svn/debug/*
755
+
672
756
BUGS
673
757
----
674
758
0 commit comments