blob: ed5eca1fcef50f910d74abb495360dc6c3fbf35b [file] [log] [blame]
Junio C Hamano9ae1a062006-07-10 08:12:341git-svn(1)
2==========
3
4NAME
5----
Junio C Hamano688eae02009-06-28 05:19:506git-svn - Bidirectional operation between a Subversion repository and git
Junio C Hamano9ae1a062006-07-10 08:12:347
8SYNOPSIS
9--------
Junio C Hamano15567bc2011-07-23 00:51:5910[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3811'git svn' <command> [options] [arguments]
Junio C Hamano9ae1a062006-07-10 08:12:3412
13DESCRIPTION
14-----------
Junio C Hamano48bc1ce2009-07-09 16:49:1915'git svn' is a simple conduit for changesets between Subversion and git.
Junio C Hamano7f80ae82008-07-30 18:31:3516It provides a bidirectional flow of changes between a Subversion and a git
Junio C Hamanocb1c44f2008-08-06 06:19:3317repository.
Junio C Hamano9ae1a062006-07-10 08:12:3418
Junio C Hamano48bc1ce2009-07-09 16:49:1919'git svn' can track a standard Subversion repository,
Junio C Hamano688eae02009-06-28 05:19:5020following the common "trunk/branches/tags" layout, with the --stdlayout option.
21It can also follow branches and tags in any layout with the -T/-t/-b options
22(see options to 'init' below, and also the 'clone' command).
Junio C Hamano9ae1a062006-07-10 08:12:3423
Junio C Hamano688eae02009-06-28 05:19:5024Once tracking a Subversion repository (with any of the above methods), the git
Junio C Hamano7f80ae82008-07-30 18:31:3525repository can be updated from Subversion by the 'fetch' command and
26Subversion updated from git by the 'dcommit' command.
Junio C Hamano9ae1a062006-07-10 08:12:3427
28COMMANDS
29--------
Junio C Hamano6b2cee12006-08-26 08:43:3130
31'init'::
Junio C Hamano00cb3712007-02-23 11:13:5232Initializes an empty git repository with additional
Junio C Hamano48bc1ce2009-07-09 16:49:1933metadata directories for 'git svn'. The Subversion URL
Junio C Hamano00cb3712007-02-23 11:13:5234may be specified as a command-line argument, or as full
35URL arguments to -T/-t/-b. Optionally, the target
36directory to operate on can be specified as a second
37argument. Normally this command initializes the current
38directory.
39
Junio C Hamano67fad6d2007-05-06 08:53:1240-T<trunk_subdir>;;
41--trunk=<trunk_subdir>;;
42-t<tags_subdir>;;
43--tags=<tags_subdir>;;
44-b<branches_subdir>;;
45--branches=<branches_subdir>;;
Junio C Hamano377018d2007-08-23 08:41:3146-s;;
47--stdlayout;;
Junio C Hamano00cb3712007-02-23 11:13:5248These are optional command-line options for init. Each of
49these flags can point to a relative repository path
Junio C Hamano688eae02009-06-28 05:19:5050(--tags=project/tags) or a full url
51(--tags=https://foo.org/project/tags).
52You can specify more than one --tags and/or --branches options, in case
53your Subversion repository places tags or branches under multiple paths.
54The option --stdlayout is
Junio C Hamano377018d2007-08-23 08:41:3155a shorthand way of setting trunk,tags,branches as the relative paths,
56which is the Subversion default. If any of the other options are given
57as well, they take precedence.
Junio C Hamano67fad6d2007-05-06 08:53:1258--no-metadata;;
Junio C Hamano00cb3712007-02-23 11:13:5259Set the 'noMetadata' option in the [svn-remote] config.
Junio C Hamano657fd8a2010-10-07 00:01:2460This option is not recommended, please read the 'svn.noMetadata'
61section of this manpage before using this option.
Junio C Hamano67fad6d2007-05-06 08:53:1262--use-svm-props;;
Junio C Hamano00cb3712007-02-23 11:13:5263Set the 'useSvmProps' option in the [svn-remote] config.
Junio C Hamano67fad6d2007-05-06 08:53:1264--use-svnsync-props;;
Junio C Hamano00cb3712007-02-23 11:13:5265Set the 'useSvnsyncProps' option in the [svn-remote] config.
Junio C Hamano67fad6d2007-05-06 08:53:1266--rewrite-root=<URL>;;
Junio C Hamano00cb3712007-02-23 11:13:5267Set the 'rewriteRoot' option in the [svn-remote] config.
Junio C Hamanod0d892c2010-01-24 20:06:2968--rewrite-uuid=<UUID>;;
69Set the 'rewriteUUID' option in the [svn-remote] config.
Junio C Hamano63c2bc92011-02-28 06:41:2870--username=<user>;;
Junio C Hamano00cb3712007-02-23 11:13:5271For transports that SVN handles authentication for (http,
72https, and plain svn), specify the username. For other
73transports (eg svn+ssh://), you must include the username in
74the URL, eg svn+ssh://foo@svn.bar.com/project
Junio C Hamano67fad6d2007-05-06 08:53:1275--prefix=<prefix>;;
Junio C Hamano00cb3712007-02-23 11:13:5276This allows one to specify a prefix which is prepended
77to the names of remotes if trunk/branches/tags are
78specified. The prefix does not automatically include a
79trailing slash, so be sure you include one in the
Junio C Hamano0a2ad892007-06-24 22:23:1280argument if that is what you want. If --branches/-b is
81specified, the prefix must include a trailing slash.
82Setting a prefix is useful if you wish to track multiple
83projects that share a common repository.
Junio C Hamano55344412009-04-12 18:31:1984--ignore-paths=<regex>;;
85When passed to 'init' or 'clone' this regular expression will
86be preserved as a config key. See 'fetch' for a description
87of '--ignore-paths'.
Junio C Hamanoaa2cd762009-07-26 08:14:0188--no-minimize-url;;
89When tracking multiple directories (using --stdlayout,
90--branches, or --tags options), git svn will attempt to connect
91to the root (or highest allowed level) of the Subversion
92repository. This default allows better tracking of history if
93entire projects are moved within a repository, but may cause
94issues on repositories where read access restrictions are in
95place. Passing '--no-minimize-url' will allow git svn to
96accept URLs as-is without attempting to connect to a higher
97level directory. This option is off by default when only
98one URL/branch is tracked (it would do little good).
Junio C Hamano9ae1a062006-07-10 08:12:3499
Junio C Hamano6b2cee12006-08-26 08:43:31100'fetch'::
Junio C Hamano00cb3712007-02-23 11:13:52101Fetch unfetched revisions from the Subversion remote we are
102tracking. The name of the [svn-remote "..."] section in the
103.git/config file may be specified as an optional command-line
104argument.
Junio C Hamano9ae1a062006-07-10 08:12:34105
Junio C Hamano8f4ac0d2009-01-19 08:35:36106--localtime;;
107Store Git commit times in the local timezone instead of UTC. This
Junio C Hamano48bc1ce2009-07-09 16:49:19108makes 'git log' (even without --date=local) show the same times
Junio C Hamano8f4ac0d2009-01-19 08:35:36109that `svn log` would in the local timezone.
Junio C Hamano48bc1ce2009-07-09 16:49:19110+
Junio C Hamano8f4ac0d2009-01-19 08:35:36111This doesn't interfere with interoperating with the Subversion
112repository you cloned from, but if you wish for your local Git
113repository to be able to interoperate with someone else's local Git
114repository, either don't use this option or you should both use it in
115the same local timezone.
116
Junio C Hamano0df868a2009-08-19 07:28:28117--parent;;
118Fetch only from the SVN parent of the current HEAD.
119
Junio C Hamanoa07e8162009-01-26 17:36:43120--ignore-paths=<regex>;;
Junio C Hamano55344412009-04-12 18:31:19121This allows one to specify a Perl regular expression that will
Junio C Hamanoa07e8162009-01-26 17:36:43122cause skipping of all matching paths from checkout from SVN.
Junio C Hamano55344412009-04-12 18:31:19123The '--ignore-paths' option should match for every 'fetch'
124(including automatic fetches due to 'clone', 'dcommit',
125'rebase', etc) on a given repository.
Junio C Hamano48bc1ce2009-07-09 16:49:19126+
127[verse]
Junio C Hamano55344412009-04-12 18:31:19128config key: svn-remote.<name>.ignore-paths
Junio C Hamano48bc1ce2009-07-09 16:49:19129+
130If the ignore-paths config key is set and the command line option is
131also given, both regular expressions will be used.
132+
Junio C Hamano55344412009-04-12 18:31:19133Examples:
Junio C Hamano48bc1ce2009-07-09 16:49:19134+
135--
136Skip "doc*" directory for every fetch;;
137+
138------------------------------------------------------------------------
139--ignore-paths="^doc"
140------------------------------------------------------------------------
Junio C Hamano55344412009-04-12 18:31:19141
Junio C Hamano48bc1ce2009-07-09 16:49:19142Skip "branches" and "tags" of first level directories;;
143+
144------------------------------------------------------------------------
145--ignore-paths="^[^/]+/(?:branches|tags)"
146------------------------------------------------------------------------
147--
Junio C Hamano55344412009-04-12 18:31:19148
Junio C Hamano00cb3712007-02-23 11:13:52149'clone'::
150Runs 'init' and 'fetch'. It will automatically create a
151directory based on the basename of the URL passed to it;
152or if a second argument is passed; it will create a directory
153and work within that. It accepts all arguments that the
154'init' and 'fetch' commands accept; with the exception of
Junio C Hamano48bc1ce2009-07-09 16:49:19155'--fetch-all' and '--parent'. After a repository is cloned,
156the 'fetch' command will be able to update revisions without
157affecting the working tree; and the 'rebase' command will be
158able to update the working tree with the latest changes.
Junio C Hamano9ae1a062006-07-10 08:12:34159
Junio C Hamano00cb3712007-02-23 11:13:52160'rebase'::
161This fetches revisions from the SVN parent of the current HEAD
162and rebases the current (uncommitted to SVN) work against it.
Junio C Hamano48bc1ce2009-07-09 16:49:19163+
164This works similarly to `svn update` or 'git pull' except that
165it preserves linear history with 'git rebase' instead of
166'git merge' for ease of dcommitting with 'git svn'.
167+
168This accepts all options that 'git svn fetch' and 'git rebase'
Junio C Hamanofce7c7e2008-07-02 03:06:38169accept. However, '--fetch-all' only fetches from the current
Junio C Hamanoa3fd83c2007-03-02 10:34:36170[svn-remote], and not all [svn-remote] definitions.
Junio C Hamano48bc1ce2009-07-09 16:49:19171+
172Like 'git rebase'; this requires that the working tree be clean
Junio C Hamanoa3fd83c2007-03-02 10:34:36173and have no uncommitted changes.
Junio C Hamano67fad6d2007-05-06 08:53:12174
Junio C Hamano103ad7f2007-03-14 11:19:26175-l;;
176--local;;
Junio C Hamano48bc1ce2009-07-09 16:49:19177Do not fetch remotely; only run 'git rebase' against the
Junio C Hamano103ad7f2007-03-14 11:19:26178last fetched commit from the upstream SVN.
Junio C Hamano6b2cee12006-08-26 08:43:31179
180'dcommit'::
Junio C Hamano79770b62007-01-07 07:43:58181Commit each diff from a specified head directly to the SVN
Junio C Hamano6b2cee12006-08-26 08:43:31182repository, and then rebase or reset (depending on whether or
Junio C Hamano79770b62007-01-07 07:43:58183not there is a diff between SVN and head). This will create
184a revision in SVN for each commit in git.
Junio C Hamano48bc1ce2009-07-09 16:49:19185It is recommended that you run 'git svn' fetch and rebase (not
Junio C Hamano79770b62007-01-07 07:43:58186pull or merge) your commits against the latest changes in the
187SVN repository.
Junio C Hamano688eae02009-06-28 05:19:50188An optional revision or branch argument may be specified, and
Junio C Hamano48bc1ce2009-07-09 16:49:19189causes 'git svn' to do all work on that revision/branch
Junio C Hamano688eae02009-06-28 05:19:50190instead of HEAD.
Junio C Hamano4bf6dca2006-12-21 02:25:57191This is advantageous over 'set-tree' (below) because it produces
Junio C Hamano6b2cee12006-08-26 08:43:31192cleaner, more linear history.
Junio C Hamano67fad6d2007-05-06 08:53:12193+
194--no-rebase;;
195After committing, do not rebase or reset.
Junio C Hamanofaa1e502008-08-10 03:55:58196--commit-url <URL>;;
197Commit to this SVN URL (the full path). This is intended to
Junio C Hamano48bc1ce2009-07-09 16:49:19198allow existing 'git svn' repositories created with one transport
Junio C Hamanofaa1e502008-08-10 03:55:58199method (e.g. `svn://` or `http://` for anonymous read) to be
200reused if a user is later given access to an alternate transport
201method (e.g. `svn+ssh://` or `https://`) for commit.
Junio C Hamano48bc1ce2009-07-09 16:49:19202+
203[verse]
Junio C Hamanoa50c35c2009-02-24 07:37:05204config key: svn-remote.<name>.commiturl
Junio C Hamanoa50c35c2009-02-24 07:37:05205config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
Junio C Hamano48bc1ce2009-07-09 16:49:19206+
207Using this option for any other purpose (don't ask) is very strongly
208discouraged.
Junio C Hamano6b2cee12006-08-26 08:43:31209
Junio C Hamano0a901522011-04-19 22:42:05210--mergeinfo=<mergeinfo>;;
211Add the given merge information during the dcommit
212(e.g. `--mergeinfo="/branches/foo:1-10"`). All svn server versions can
213store this information (as a property), and svn clients starting from
214version 1.5 can make use of it. 'git svn' currently does not use it
215and does not set it automatically.
216
Junio C Hamanoa476efa2008-10-10 15:31:42217'branch'::
218Create a branch in the SVN repository.
219
220-m;;
221--message;;
222Allows to specify the commit message.
223
224-t;;
225--tag;;
226Create a tag by using the tags_subdir instead of the branches_subdir
227specified during git svn init.
228
Junio C Hamano688eae02009-06-28 05:19:50229-d;;
230--destination;;
231If more than one --branches (or --tags) option was given to the 'init'
232or 'clone' command, you must provide the location of the branch (or
233tag) you wish to create in the SVN repository. The value of this
234option must match one of the paths specified by a --branches (or
235--tags) option. You can see these paths with the commands
236+
237git config --get-all svn-remote.<name>.branches
238git config --get-all svn-remote.<name>.tags
239+
240where <name> is the name of the SVN repository as specified by the -R option to
241'init' (or "svn" by default).
242
Junio C Hamanod0d892c2010-01-24 20:06:29243--username;;
244Specify the SVN username to perform the commit as. This option overrides
Junio C Hamano072d22b2010-05-10 02:49:38245the 'username' configuration property.
Junio C Hamanod0d892c2010-01-24 20:06:29246
247--commit-url;;
248Use the specified URL to connect to the destination Subversion
249repository. This is useful in cases where the source SVN
250repository is read-only. This option overrides configuration
251property 'commiturl'.
252+
253git config --get-all svn-remote.<name>.commiturl
254+
255
Junio C Hamanoa476efa2008-10-10 15:31:42256'tag'::
257Create a tag in the SVN repository. This is a shorthand for
258'branch -t'.
259
Junio C Hamano43d01342006-10-12 04:07:32260'log'::
261This should make it easy to look up svn log messages when svn
262users refer to -r/--revision numbers.
Junio C Hamanoa3fd83c2007-03-02 10:34:36263+
264The following features from `svn log' are supported:
265+
266--
Junio C Hamano48bc1ce2009-07-09 16:49:19267-r <n>[:<n>];;
268--revision=<n>[:<n>];;
Junio C Hamanoa3fd83c2007-03-02 10:34:36269is supported, non-numeric args are not:
270HEAD, NEXT, BASE, PREV, etc ...
Junio C Hamano48bc1ce2009-07-09 16:49:19271-v;;
272--verbose;;
Junio C Hamanoa3fd83c2007-03-02 10:34:36273it's not completely compatible with the --verbose
274output in svn log, but reasonably close.
275--limit=<n>;;
276is NOT the same as --max-count, doesn't count
277merged/excluded commits
278--incremental;;
279supported
280--
281+
282New features:
283+
284--
285--show-commit;;
286shows the git commit sha1, as well
287--oneline;;
288our version of --pretty=oneline
289--
290+
Junio C Hamano24bc09a2008-02-28 00:27:44291NOTE: SVN itself only stores times in UTC and nothing else. The regular svn
292client converts the UTC time to the local time (or based on the TZ=
293environment). This command has the same behaviour.
294+
Junio C Hamano48bc1ce2009-07-09 16:49:19295Any other arguments are passed directly to 'git log'
Junio C Hamano43d01342006-10-12 04:07:32296
Junio C Hamano9c334152008-02-12 03:18:52297'blame'::
Junio C Hamano869bb802008-05-12 00:29:47298 Show what revision and author last modified each line of a file. The
299 output of this mode is format-compatible with the output of
300 `svn blame' by default. Like the SVN blame command,
301 local uncommitted changes in the working copy are ignored;
302 the version of the file in the HEAD revision is annotated. Unknown
Junio C Hamano48bc1ce2009-07-09 16:49:19303 arguments are passed directly to 'git blame'.
Junio C Hamano9c334152008-02-12 03:18:52304+
Junio C Hamano869bb802008-05-12 00:29:47305--git-format;;
Junio C Hamano48bc1ce2009-07-09 16:49:19306Produce output in the same format as 'git blame', but with
Junio C Hamano869bb802008-05-12 00:29:47307SVN revision numbers instead of git commit hashes. In this mode,
308changes that haven't been committed to SVN (including local
309working-copy edits) are shown as revision 0.
Junio C Hamano9c334152008-02-12 03:18:52310
Junio C Hamano469d60e2007-04-29 18:30:34311'find-rev'::
312When given an SVN revision number of the form 'rN', returns the
Junio C Hamanob63afff2007-05-01 03:05:55313corresponding git commit hash (this can optionally be followed by a
314tree-ish to specify which branch should be searched). When given a
315tree-ish, returns the corresponding SVN revision number.
Junio C Hamano469d60e2007-04-29 18:30:34316
Junio C Hamano4bf6dca2006-12-21 02:25:57317'set-tree'::
Junio C Hamano43d01342006-10-12 04:07:32318You should consider using 'dcommit' instead of this command.
Junio C Hamano9ae1a062006-07-10 08:12:34319Commit specified commit or tree objects to SVN. This relies on
320your imported fetch data being up-to-date. This makes
321absolutely no attempts to do patching when committing to SVN, it
322simply overwrites files with those specified in the tree or
323commit. All merging is assumed to have taken place
Junio C Hamano48bc1ce2009-07-09 16:49:19324independently of 'git svn' functions.
Junio C Hamano9ae1a062006-07-10 08:12:34325
Junio C Hamano47d68a52008-05-06 06:35:40326'create-ignore'::
Junio C Hamano47d68a52008-05-06 06:35:40327Recursively finds the svn:ignore property on directories and
328creates matching .gitignore files. The resulting files are staged to
Junio C Hamanofeeb1be2008-05-22 00:53:35329be committed, but are not committed. Use -r/--revision to refer to a
Junio C Hamanocb1c44f2008-08-06 06:19:33330specific revision.
Junio C Hamano47d68a52008-05-06 06:35:40331
Junio C Hamano6b2cee12006-08-26 08:43:31332'show-ignore'::
Junio C Hamano9ae1a062006-07-10 08:12:34333Recursively finds and lists the svn:ignore property on
334directories. The output is suitable for appending to
335the $GIT_DIR/info/exclude file.
336
Junio C Hamanoa5574462009-11-18 07:39:28337'mkdirs'::
338Attempts to recreate empty directories that core git cannot track
339based on information in $GIT_DIR/svn/<refname>/unhandled.log files.
340Empty directories are automatically recreated when using
341"git svn clone" and "git svn rebase", so "mkdirs" is intended
342for use after commands like "git checkout" or "git reset".
Junio C Hamano209ebe82011-04-27 21:09:59343(See the svn-remote.<name>.automkdirs config file option for
344more information.)
Junio C Hamanoa5574462009-11-18 07:39:28345
Junio C Hamano43d01342006-10-12 04:07:32346'commit-diff'::
347Commits the diff of two tree-ish arguments from the
Junio C Hamano48bc1ce2009-07-09 16:49:19348command-line. This command does not rely on being inside an `git svn
Junio C Hamanofce7c7e2008-07-02 03:06:38349init`-ed repository. This command takes three arguments, (a) the
Junio C Hamano43d01342006-10-12 04:07:32350original tree to diff against, (b) the new tree result, (c) the
351URL of the target Subversion repository. The final argument
Junio C Hamano48bc1ce2009-07-09 16:49:19352(URL) may be omitted if you are working from a 'git svn'-aware
353repository (that has been `init`-ed with 'git svn').
Junio C Hamano23db8852006-11-09 23:35:53354The -r<revision> option is required for this.
Junio C Hamano43d01342006-10-12 04:07:32355
Junio C Hamanoa0970542007-11-23 08:43:30356'info'::
357Shows information about a file or directory similar to what
358`svn info' provides. Does not currently support a -r/--revision
359argument. Use the --url option to output only the value of the
360'URL:' field.
361
Junio C Hamanofeeb1be2008-05-22 00:53:35362'proplist'::
363Lists the properties stored in the Subversion repository about a
364given file or directory. Use -r/--revision to refer to a specific
365Subversion revision.
366
367'propget'::
368Gets the Subversion property given as the first argument, for a
369file. A specific revision can be specified with -r/--revision.
370
371'show-externals'::
372Shows the Subversion externals. Use -r/--revision to specify a
373specific revision.
374
Junio C Hamanoaa2cd762009-07-26 08:14:01375'gc'::
376Compress $GIT_DIR/svn/<refname>/unhandled.log files in .git/svn
377and remove $GIT_DIR/svn/<refname>index files in .git/svn.
378
Junio C Hamano688eae02009-06-28 05:19:50379'reset'::
380Undoes the effects of 'fetch' back to the specified revision.
381This allows you to re-'fetch' an SVN revision. Normally the
382contents of an SVN revision should never change and 'reset'
383should not be necessary. However, if SVN permissions change,
384or if you alter your --ignore-paths option, a 'fetch' may fail
385with "not found in commit" (file not previously visible) or
386"checksum mismatch" (missed a modification). If the problem
387file cannot be ignored forever (with --ignore-paths) the only
388way to repair the repo is to use 'reset'.
Junio C Hamano48bc1ce2009-07-09 16:49:19389+
Junio C Hamano688eae02009-06-28 05:19:50390Only the rev_map and refs/remotes/git-svn are changed. Follow 'reset'
Junio C Hamano48bc1ce2009-07-09 16:49:19391with a 'fetch' and then 'git reset' or 'git rebase' to move local
Junio C Hamano688eae02009-06-28 05:19:50392branches onto the new tree.
393
Junio C Hamano48bc1ce2009-07-09 16:49:19394-r <n>;;
395--revision=<n>;;
Junio C Hamano688eae02009-06-28 05:19:50396Specify the most recent revision to keep. All later revisions
397are discarded.
Junio C Hamano48bc1ce2009-07-09 16:49:19398-p;;
399--parent;;
Junio C Hamano688eae02009-06-28 05:19:50400Discard the specified revision as well, keeping the nearest
401parent instead.
402Example:;;
403Assume you have local changes in "master", but you need to refetch "r2".
Junio C Hamano48bc1ce2009-07-09 16:49:19404+
Junio C Hamano688eae02009-06-28 05:19:50405------------
406 r1---r2---r3 remotes/git-svn
407 \
408 A---B master
409------------
Junio C Hamano48bc1ce2009-07-09 16:49:19410+
Junio C Hamano688eae02009-06-28 05:19:50411Fix the ignore-paths or SVN permissions problem that caused "r2" to
412be incomplete in the first place. Then:
Junio C Hamano48bc1ce2009-07-09 16:49:19413+
Junio C Hamano688eae02009-06-28 05:19:50414[verse]
415git svn reset -r2 -p
416git svn fetch
Junio C Hamano48bc1ce2009-07-09 16:49:19417+
Junio C Hamano688eae02009-06-28 05:19:50418------------
419 r1---r2'--r3' remotes/git-svn
420 \
421 r2---r3---A---B master
422------------
Junio C Hamano48bc1ce2009-07-09 16:49:19423+
424Then fixup "master" with 'git rebase'.
425Do NOT use 'git merge' or your history will not be compatible with a
Junio C Hamano688eae02009-06-28 05:19:50426future 'dcommit'!
Junio C Hamano48bc1ce2009-07-09 16:49:19427+
Junio C Hamano688eae02009-06-28 05:19:50428[verse]
429git rebase --onto remotes/git-svn A^ master
Junio C Hamano48bc1ce2009-07-09 16:49:19430+
Junio C Hamano688eae02009-06-28 05:19:50431------------
432 r1---r2'--r3' remotes/git-svn
433 \
434 A'--B' master
435------------
436
Junio C Hamano9ae1a062006-07-10 08:12:34437OPTIONS
438-------
Junio C Hamano6b2cee12006-08-26 08:43:31439
Junio C Hamanod2179ef2010-10-22 04:12:17440--shared[=(false|true|umask|group|all|world|everybody)]::
Junio C Hamano43d01342006-10-12 04:07:32441--template=<template_directory>::
442Only used with the 'init' command.
Junio C Hamano48bc1ce2009-07-09 16:49:19443These are passed directly to 'git init'.
Junio C Hamano43d01342006-10-12 04:07:32444
Junio C Hamano63c2bc92011-02-28 06:41:28445-r <arg>::
446--revision <arg>::
Junio C Hamano48bc1ce2009-07-09 16:49:19447 Used with the 'fetch' command.
448+
Junio C Hamano00cb3712007-02-23 11:13:52449This allows revision ranges for partial/cauterized history
450to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
451$NUMBER:HEAD, and BASE:$NUMBER are all supported.
Junio C Hamano48bc1ce2009-07-09 16:49:19452+
Junio C Hamano00cb3712007-02-23 11:13:52453This can allow you to make partial mirrors when running fetch;
454but is generally not recommended because history will be skipped
455and lost.
Junio C Hamano9ae1a062006-07-10 08:12:34456
457-::
458--stdin::
Junio C Hamano48bc1ce2009-07-09 16:49:19459Only used with the 'set-tree' command.
460+
Junio C Hamano6b2cee12006-08-26 08:43:31461Read a list of commits from stdin and commit them in reverse
462order. Only the leading sha1 is read from each line, so
Junio C Hamano48bc1ce2009-07-09 16:49:19463'git rev-list --pretty=oneline' output can be used.
Junio C Hamano9ae1a062006-07-10 08:12:34464
465--rmdir::
Junio C Hamano48bc1ce2009-07-09 16:49:19466Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
467+
Junio C Hamano6b2cee12006-08-26 08:43:31468Remove directories from the SVN tree if there are no files left
469behind. SVN can version empty directories, and they are not
470removed by default if there are no files left in them. git
471cannot version empty directories. Enabling this flag will make
472the commit to SVN act like git.
Junio C Hamano48bc1ce2009-07-09 16:49:19473+
474[verse]
Junio C Hamano7ad22dc2007-01-29 02:55:48475config key: svn.rmdir
Junio C Hamano9ae1a062006-07-10 08:12:34476
477-e::
478--edit::
Junio C Hamano48bc1ce2009-07-09 16:49:19479Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
480+
Junio C Hamano6b2cee12006-08-26 08:43:31481Edit the commit message before committing to SVN. This is off by
482default for objects that are commits, and forced on when committing
483tree objects.
Junio C Hamano48bc1ce2009-07-09 16:49:19484+
485[verse]
Junio C Hamano7ad22dc2007-01-29 02:55:48486config key: svn.edit
Junio C Hamano9ae1a062006-07-10 08:12:34487
488-l<num>::
489--find-copies-harder::
Junio C Hamano48bc1ce2009-07-09 16:49:19490Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
491+
492They are both passed directly to 'git diff-tree'; see
Junio C Hamano35738e82008-01-07 07:55:46493linkgit:git-diff-tree[1] for more information.
Junio C Hamano48bc1ce2009-07-09 16:49:19494+
Junio C Hamano6b2cee12006-08-26 08:43:31495[verse]
Junio C Hamano7ad22dc2007-01-29 02:55:48496config key: svn.l
497config key: svn.findcopiesharder
Junio C Hamano9ae1a062006-07-10 08:12:34498
499-A<filename>::
500--authors-file=<filename>::
Junio C Hamano48bc1ce2009-07-09 16:49:19501Syntax is compatible with the file used by 'git cvsimport':
502+
Junio C Hamano9ae1a062006-07-10 08:12:34503------------------------------------------------------------------------
Junio C Hamano6b2cee12006-08-26 08:43:31504loginname = Joe User <user@example.com>
Junio C Hamano9ae1a062006-07-10 08:12:34505------------------------------------------------------------------------
Junio C Hamano48bc1ce2009-07-09 16:49:19506+
507If this option is specified and 'git svn' encounters an SVN
508committer name that does not exist in the authors-file, 'git svn'
Junio C Hamano6b2cee12006-08-26 08:43:31509will abort operation. The user will then have to add the
Junio C Hamano48bc1ce2009-07-09 16:49:19510appropriate entry. Re-running the previous 'git svn' command
Junio C Hamano6b2cee12006-08-26 08:43:31511after the authors-file is modified should continue operation.
Junio C Hamano48bc1ce2009-07-09 16:49:19512+
513[verse]
Junio C Hamano7ad22dc2007-01-29 02:55:48514config key: svn.authorsfile
Junio C Hamano43d01342006-10-12 04:07:32515
Junio C Hamano52d5def2009-05-21 16:27:43516--authors-prog=<filename>::
Junio C Hamano48bc1ce2009-07-09 16:49:19517If this option is specified, for each SVN committer name that
518does not exist in the authors file, the given file is executed
519with the committer name as the first argument. The program is
520expected to return a single line of the form "Name <email>",
521which will be treated as if included in the authors file.
Junio C Hamano52d5def2009-05-21 16:27:43522
Junio C Hamano43d01342006-10-12 04:07:32523-q::
524--quiet::
Junio C Hamano48bc1ce2009-07-09 16:49:19525Make 'git svn' less verbose. Specify a second time to make it
Junio C Hamano9572e922009-04-02 06:52:03526even less verbose.
Junio C Hamano43d01342006-10-12 04:07:32527
528--repack[=<n>]::
Junio C Hamanoa3fd83c2007-03-02 10:34:36529--repack-flags=<flags>::
Junio C Hamano48bc1ce2009-07-09 16:49:19530These should help keep disk usage sane for large fetches with
531many revisions.
532+
Junio C Hamanoa3fd83c2007-03-02 10:34:36533--repack takes an optional argument for the number of revisions
534to fetch before repacking. This defaults to repacking every
5351000 commits fetched if no argument is specified.
Junio C Hamano48bc1ce2009-07-09 16:49:19536+
537--repack-flags are passed directly to 'git repack'.
538+
Junio C Hamanoa3fd83c2007-03-02 10:34:36539[verse]
Junio C Hamano7ad22dc2007-01-29 02:55:48540config key: svn.repack
541config key: svn.repackflags
Junio C Hamano6b2cee12006-08-26 08:43:31542
543-m::
544--merge::
545-s<strategy>::
546--strategy=<strategy>::
Junio C Hamano48bc1ce2009-07-09 16:49:19547These are only used with the 'dcommit' and 'rebase' commands.
548+
549Passed directly to 'git rebase' when using 'dcommit' if a
550'git reset' cannot be used (see 'dcommit').
Junio C Hamano6b2cee12006-08-26 08:43:31551
552-n::
553--dry-run::
Junio C Hamano48bc1ce2009-07-09 16:49:19554This can be used with the 'dcommit', 'rebase', 'branch' and
555'tag' commands.
556+
Junio C Hamano9e1793f2008-06-02 07:31:16557For 'dcommit', print out the series of git arguments that would show
Junio C Hamano6b2cee12006-08-26 08:43:31558which diffs would be committed to SVN.
Junio C Hamano48bc1ce2009-07-09 16:49:19559+
Junio C Hamano9e1793f2008-06-02 07:31:16560For 'rebase', display the local branch associated with the upstream svn
561repository associated with the current branch and the URL of svn
562repository that will be fetched from.
Junio C Hamano48bc1ce2009-07-09 16:49:19563+
Junio C Hamanoa476efa2008-10-10 15:31:42564For 'branch' and 'tag', display the urls that will be used for copying when
565creating the branch or tag.
566
Junio C Hamano4f018922011-05-01 23:54:06567--use-log-author::
568When retrieving svn commits into git (as part of 'fetch', 'rebase', or
569'dcommit' operations), look for the first `From:` or `Signed-off-by:` line
570in the log message and use that as the author string.
571--add-author-from::
572When committing to svn from git (as part of 'commit-diff', 'set-tree' or 'dcommit'
573operations), if the existing log message doesn't already have a
574`From:` or `Signed-off-by:` line, append a `From:` line based on the
575git commit's author string. If you use this, then `--use-log-author`
576will retrieve a valid author string for all commits.
577
Junio C Hamano9ae1a062006-07-10 08:12:34578
579ADVANCED OPTIONS
580----------------
Junio C Hamano6b2cee12006-08-26 08:43:31581
Junio C Hamano9ae1a062006-07-10 08:12:34582-i<GIT_SVN_ID>::
583--id <GIT_SVN_ID>::
Junio C Hamano48bc1ce2009-07-09 16:49:19584This sets GIT_SVN_ID (instead of using the environment). This
585allows the user to override the default refname to fetch from
586when tracking a single URL. The 'log' and 'dcommit' commands
587no longer require this switch as an argument.
Junio C Hamano00cb3712007-02-23 11:13:52588
589-R<remote name>::
590--svn-remote <remote name>::
591Specify the [svn-remote "<remote name>"] section to use,
592this allows SVN multiple repositories to be tracked.
593Default: "svn"
Junio C Hamano6b2cee12006-08-26 08:43:31594
Junio C Hamano43d01342006-10-12 04:07:32595--follow-parent::
596This is especially helpful when we're tracking a directory
597that has been moved around within the repository, or if we
598started tracking a branch and never tracked the trunk it was
Junio C Hamano00cb3712007-02-23 11:13:52599descended from. This feature is enabled by default, use
600--no-follow-parent to disable it.
Junio C Hamano48bc1ce2009-07-09 16:49:19601+
602[verse]
Junio C Hamano7ad22dc2007-01-29 02:55:48603config key: svn.followparent
Junio C Hamano43d01342006-10-12 04:07:32604
Junio C Hamano00cb3712007-02-23 11:13:52605CONFIG FILE-ONLY OPTIONS
606------------------------
Junio C Hamano00cb3712007-02-23 11:13:52607
608svn.noMetadata::
609svn-remote.<name>.noMetadata::
Junio C Hamano48bc1ce2009-07-09 16:49:19610This gets rid of the 'git-svn-id:' lines at the end of every commit.
611+
Junio C Hamano657fd8a2010-10-07 00:01:24612This option can only be used for one-shot imports as 'git svn'
613will not be able to fetch again without metadata. Additionally,
614if you lose your .git/svn/**/.rev_map.* files, 'git svn' will not
615be able to rebuild them.
Junio C Hamano48bc1ce2009-07-09 16:49:19616+
617The 'git svn log' command will not work on repositories using
Junio C Hamanoa3fd83c2007-03-02 10:34:36618this, either. Using this conflicts with the 'useSvmProps'
619option for (hopefully) obvious reasons.
Junio C Hamano657fd8a2010-10-07 00:01:24620+
621This option is NOT recommended as it makes it difficult to track down
622old references to SVN revision numbers in existing documentation, bug
623reports and archives. If you plan to eventually migrate from SVN to git
624and are certain about dropping SVN history, consider
625linkgit:git-filter-branch[1] instead. filter-branch also allows
Junio C Hamano7165bf72011-01-04 22:06:18626reformatting of metadata for ease-of-reading and rewriting authorship
Junio C Hamano657fd8a2010-10-07 00:01:24627info for non-"svn.authorsFile" users.
Junio C Hamano43d01342006-10-12 04:07:32628
Junio C Hamano00cb3712007-02-23 11:13:52629svn.useSvmProps::
630svn-remote.<name>.useSvmProps::
Junio C Hamano48bc1ce2009-07-09 16:49:19631This allows 'git svn' to re-map repository URLs and UUIDs from
632mirrors created using SVN::Mirror (or svk) for metadata.
633+
Junio C Hamanoa3fd83c2007-03-02 10:34:36634If an SVN revision has a property, "svm:headrev", it is likely
635that the revision was created by SVN::Mirror (also used by SVK).
636The property contains a repository UUID and a revision. We want
637to make it look like we are mirroring the original URL, so
638introduce a helper function that returns the original identity
639URL and UUID, and use it when generating metadata in commit
640messages.
Junio C Hamano9ae1a062006-07-10 08:12:34641
Junio C Hamano00cb3712007-02-23 11:13:52642svn.useSvnsyncProps::
643svn-remote.<name>.useSvnsyncprops::
644Similar to the useSvmProps option; this is for users
645of the svnsync(1) command distributed with SVN 1.4.x and
646later.
Junio C Hamano9ae1a062006-07-10 08:12:34647
Junio C Hamano00cb3712007-02-23 11:13:52648svn-remote.<name>.rewriteRoot::
649This allows users to create repositories from alternate
Junio C Hamano48bc1ce2009-07-09 16:49:19650URLs. For example, an administrator could run 'git svn' on the
Junio C Hamano00cb3712007-02-23 11:13:52651server locally (accessing via file://) but wish to distribute
652the repository with a public http:// or svn:// URL in the
653metadata so users of it will see the public URL.
Junio C Hamano6b2cee12006-08-26 08:43:31654
Junio C Hamanod0d892c2010-01-24 20:06:29655svn-remote.<name>.rewriteUUID::
656Similar to the useSvmProps option; this is for users who need
657to remap the UUID manually. This may be useful in situations
658where the original UUID is not available via either useSvmProps
659or useSvnsyncProps.
660
Junio C Hamanof7e049c2011-04-11 23:48:36661svn-remote.<name>.pushurl::
662
663Similar to git's 'remote.<name>.pushurl', this key is designed
664to be used in cases where 'url' points to an SVN repository
665via a read-only transport, to provide an alternate read/write
666transport. It is assumed that both keys point to the same
667repository. Unlike 'commiturl', 'pushurl' is a base path. If
668either 'commiturl' or 'pushurl' could be used, 'commiturl'
669takes precedence.
670
Junio C Hamanob3250062009-02-11 20:16:50671svn.brokenSymlinkWorkaround::
Junio C Hamano48bc1ce2009-07-09 16:49:19672This disables potentially expensive checks to workaround
673broken symlinks checked into SVN by broken clients. Set this
674option to "false" if you track a SVN repository with many
675empty blobs that are not symlinks. This option may be changed
676while 'git svn' is running and take effect on the next
677revision fetched. If unset, 'git svn' assumes this option to
678be "true".
Junio C Hamano0538b892008-06-20 04:18:33679
Junio C Hamanoa9788762010-08-03 15:15:54680svn.pathnameencoding::
681This instructs git svn to recode pathnames to a given encoding.
682It can be used by windows users and by those who work in non-utf8
683locales to avoid corrupted file names with non-ASCII characters.
684Valid encodings are the ones supported by Perl's Encode module.
685
Junio C Hamano209ebe82011-04-27 21:09:59686svn-remote.<name>.automkdirs::
687Normally, the "git svn clone" and "git svn rebase" commands
688attempt to recreate empty directories that are in the
689Subversion repository. If this option is set to "false", then
690empty directories will only be created if the "git svn mkdirs"
691command is run explicitly. If unset, 'git svn' assumes this
692option to be "true".
693
Junio C Hamanod0d892c2010-01-24 20:06:29694Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
Junio C Hamano48bc1ce2009-07-09 16:49:19695options all affect the metadata generated and used by 'git svn'; they
Junio C Hamano00cb3712007-02-23 11:13:52696*must* be set in the configuration file before any history is imported
697and these settings should never be changed once they are set.
Junio C Hamano9ae1a062006-07-10 08:12:34698
Junio C Hamanod0d892c2010-01-24 20:06:29699Additionally, only one of these options can be used per svn-remote
700section because they affect the 'git-svn-id:' metadata line, except
701for rewriteRoot and rewriteUUID which can be used together.
Junio C Hamano47c1e3c2006-09-25 04:45:55702
Junio C Hamano9ae1a062006-07-10 08:12:34703
Junio C Hamanoa3fd83c2007-03-02 10:34:36704BASIC EXAMPLES
705--------------
Junio C Hamano9ae1a062006-07-10 08:12:34706
Junio C Hamano764a6672007-10-23 01:23:31707Tracking and contributing to the trunk of a Subversion-managed project:
Junio C Hamano9ae1a062006-07-10 08:12:34708
709------------------------------------------------------------------------
Junio C Hamano00cb3712007-02-23 11:13:52710# Clone a repo (like git clone):
Junio C Hamanoa476efa2008-10-10 15:31:42711git svn clone http://svn.example.com/project/trunk
Junio C Hamano00cb3712007-02-23 11:13:52712# Enter the newly cloned directory:
713cd trunk
Junio C Hamano48bc1ce2009-07-09 16:49:19714# You should be on master branch, double-check with 'git branch'
Junio C Hamano00cb3712007-02-23 11:13:52715git branch
716# Do some work and commit locally to git:
717git commit ...
718# Something is committed to SVN, rebase your local changes against the
719# latest changes in SVN:
Junio C Hamanofce7c7e2008-07-02 03:06:38720git svn rebase
Junio C Hamano00cb3712007-02-23 11:13:52721# Now commit your changes (that were committed previously using git) to SVN,
722# as well as automatically updating your working HEAD:
Junio C Hamanofce7c7e2008-07-02 03:06:38723git svn dcommit
Junio C Hamano9ae1a062006-07-10 08:12:34724# Append svn:ignore settings to the default git exclude file:
Junio C Hamanofce7c7e2008-07-02 03:06:38725git svn show-ignore >> .git/info/exclude
Junio C Hamano9ae1a062006-07-10 08:12:34726------------------------------------------------------------------------
727
Junio C Hamanoa8d072a2007-01-05 07:46:25728Tracking and contributing to an entire Subversion-managed project
729(complete with a trunk, tags and branches):
Junio C Hamanoa8d072a2007-01-05 07:46:25730
731------------------------------------------------------------------------
Junio C Hamano00cb3712007-02-23 11:13:52732# Clone a repo (like git clone):
Junio C Hamanoa476efa2008-10-10 15:31:42733git svn clone http://svn.example.com/project -T trunk -b branches -t tags
Junio C Hamano00cb3712007-02-23 11:13:52734# View all branches and tags you have cloned:
735git branch -r
Junio C Hamanoa476efa2008-10-10 15:31:42736# Create a new branch in SVN
737 git svn branch waldo
Junio C Hamano00cb3712007-02-23 11:13:52738# Reset your master to trunk (or any other branch, replacing 'trunk'
739# with the appropriate name):
740git reset --hard remotes/trunk
741# You may only dcommit to one branch/tag/trunk at a time. The usage
Junio C Hamanoa3fd83c2007-03-02 10:34:36742# of dcommit/rebase/show-ignore should be the same as above.
Junio C Hamanoa8d072a2007-01-05 07:46:25743------------------------------------------------------------------------
744
Junio C Hamano48bc1ce2009-07-09 16:49:19745The initial 'git svn clone' can be quite time-consuming
Junio C Hamanoe9bfa9b2007-08-07 06:06:11746(especially for large Subversion repositories). If multiple
747people (or one person with multiple machines) want to use
Junio C Hamano48bc1ce2009-07-09 16:49:19748'git svn' to interact with the same Subversion repository, you can
749do the initial 'git svn clone' to a repository on a server and
750have each person clone that repository with 'git clone':
Junio C Hamanoe9bfa9b2007-08-07 06:06:11751
752------------------------------------------------------------------------
753# Do the initial import on a server
Junio C Hamanoa476efa2008-10-10 15:31:42754ssh server "cd /pub && git svn clone http://svn.example.com/project
Junio C Hamanof7bb6692008-01-27 08:23:46755# Clone locally - make sure the refs/remotes/ space matches the server
756mkdir project
757cd project
Junio C Hamanofce7c7e2008-07-02 03:06:38758git init
Junio C Hamanof7bb6692008-01-27 08:23:46759git remote add origin server:/pub/project
Junio C Hamanob218ad82011-01-08 00:21:03760git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
Junio C Hamanof7bb6692008-01-27 08:23:46761git fetch
Junio C Hamanob218ad82011-01-08 00:21:03762# Prevent fetch/pull from remote git server in the future,
763# we only want to use git svn for future updates
764git config --remove-section remote.origin
Junio C Hamanod3452a02008-11-15 08:07:55765# Create a local branch from one of the branches just fetched
766git checkout -b master FETCH_HEAD
Junio C Hamano48bc1ce2009-07-09 16:49:19767# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
Junio C Hamanoa476efa2008-10-10 15:31:42768git svn init http://svn.example.com/project
Junio C Hamanoe9bfa9b2007-08-07 06:06:11769# Pull the latest changes from Subversion
Junio C Hamanofce7c7e2008-07-02 03:06:38770git svn rebase
Junio C Hamanoe9bfa9b2007-08-07 06:06:11771------------------------------------------------------------------------
772
Junio C Hamano79770b62007-01-07 07:43:58773REBASE VS. PULL/MERGE
774---------------------
Junio C Hamano6b2cee12006-08-26 08:43:31775
Junio C Hamano48bc1ce2009-07-09 16:49:19776Originally, 'git svn' recommended that the 'remotes/git-svn' branch be
Junio C Hamano79770b62007-01-07 07:43:58777pulled or merged from. This is because the author favored
Junio C Hamanofce7c7e2008-07-02 03:06:38778`git svn set-tree B` to commit a single head rather than the
779`git svn set-tree A..B` notation to commit multiple commits.
Junio C Hamano6b2cee12006-08-26 08:43:31780
Junio C Hamanofce7c7e2008-07-02 03:06:38781If you use `git svn set-tree A..B` to commit several diffs and you do
Junio C Hamano79770b62007-01-07 07:43:58782not have the latest remotes/git-svn merged into my-branch, you should
Junio C Hamanofce7c7e2008-07-02 03:06:38783use `git svn rebase` to update your work branch instead of `git pull` or
Junio C Hamano0e88f3e2009-06-21 08:03:25784`git merge`. `pull`/`merge` can cause non-linear history to be flattened
Junio C Hamano79770b62007-01-07 07:43:58785when committing into SVN, which can lead to merge commits reversing
786previous commits in SVN.
Junio C Hamano6b2cee12006-08-26 08:43:31787
Junio C Hamanob77f8192011-05-05 01:30:38788MERGE TRACKING
789--------------
790While 'git svn' can track
Junio C Hamanod2d9ae12007-09-19 02:27:57791copy history (including branches and tags) for repositories adopting a
792standard layout, it cannot yet represent merge history that happened
793inside git back upstream to SVN users. Therefore it is advised that
794users keep history as linear as possible inside git to ease
795compatibility with SVN (see the CAVEATS section below).
Junio C Hamano9ae1a062006-07-10 08:12:34796
Junio C Hamanobdebabb2007-08-23 00:25:09797CAVEATS
798-------
799
Junio C Hamanob77f8192011-05-05 01:30:38800For the sake of simplicity and interoperating with Subversion,
801it is recommended that all 'git svn' users clone, fetch and dcommit
Junio C Hamano48bc1ce2009-07-09 16:49:19802directly from the SVN server, and avoid all 'git clone'/'pull'/'merge'/'push'
Junio C Hamanobdebabb2007-08-23 00:25:09803operations between git repositories and branches. The recommended
804method of exchanging code between git branches and users is
Junio C Hamano48bc1ce2009-07-09 16:49:19805'git format-patch' and 'git am', or just 'dcommit'ing to the SVN repository.
Junio C Hamanobdebabb2007-08-23 00:25:09806
Junio C Hamano48bc1ce2009-07-09 16:49:19807Running 'git merge' or 'git pull' is NOT recommended on a branch you
Junio C Hamanob77f8192011-05-05 01:30:38808plan to 'dcommit' from because Subversion users cannot see any
Junio C Hamanobdebabb2007-08-23 00:25:09809merges you've made. Furthermore, if you merge or pull from a git branch
Junio C Hamanofce7c7e2008-07-02 03:06:38810that is a mirror of an SVN branch, 'dcommit' may commit to the wrong
Junio C Hamanobdebabb2007-08-23 00:25:09811branch.
812
Junio C Hamanoa5574462009-11-18 07:39:28813If you do merge, note the following rule: 'git svn dcommit' will
814attempt to commit on top of the SVN commit named in
815------------------------------------------------------------------------
816git log --grep=^git-svn-id: --first-parent -1
817------------------------------------------------------------------------
818You 'must' therefore ensure that the most recent commit of the branch
819you want to dcommit to is the 'first' parent of the merge. Chaos will
820ensue otherwise, especially if the first parent is an older commit on
821the same SVN branch.
822
Junio C Hamano48bc1ce2009-07-09 16:49:19823'git clone' does not clone branches under the refs/remotes/ hierarchy or
824any 'git svn' metadata, or config. So repositories created and managed with
825using 'git svn' should use 'rsync' for cloning, if cloning is to be done
Junio C Hamanobdebabb2007-08-23 00:25:09826at all.
827
Junio C Hamano48bc1ce2009-07-09 16:49:19828Since 'dcommit' uses rebase internally, any git branches you 'git push' to
Junio C Hamanofce7c7e2008-07-02 03:06:38829before 'dcommit' on will require forcing an overwrite of the existing ref
Junio C Hamanobdebabb2007-08-23 00:25:09830on the remote repository. This is generally considered bad practice,
Junio C Hamanofce7c7e2008-07-02 03:06:38831see the linkgit:git-push[1] documentation for details.
Junio C Hamanobdebabb2007-08-23 00:25:09832
Junio C Hamanofce7c7e2008-07-02 03:06:38833Do not use the --amend option of linkgit:git-commit[1] on a change you've
Junio C Hamanobdebabb2007-08-23 00:25:09834already dcommitted. It is considered bad practice to --amend commits
835you've already pushed to a remote repository for other users, and
836dcommit with SVN is analogous to that.
837
Junio C Hamano48bc1ce2009-07-09 16:49:19838When using multiple --branches or --tags, 'git svn' does not automatically
Junio C Hamano688eae02009-06-28 05:19:50839handle name collisions (for example, if two branches from different paths have
840the same name, or if a branch and a tag have the same name). In these cases,
841use 'init' to set up your git repository then, before your first 'fetch', edit
842the .git/config file so that the branches and tags are associated with
843different name spaces. For example:
844
845branches = stable/*:refs/remotes/svn/stable/*
846branches = debug/*:refs/remotes/svn/debug/*
847
Junio C Hamano9ae1a062006-07-10 08:12:34848BUGS
849----
Junio C Hamano43d01342006-10-12 04:07:32850
Junio C Hamano00cb3712007-02-23 11:13:52851We ignore all SVN properties except svn:executable. Any unhandled
852properties are logged to $GIT_DIR/svn/<refname>/unhandled.log
Junio C Hamano9ae1a062006-07-10 08:12:34853
Junio C Hamano9ae1a062006-07-10 08:12:34854Renamed and copied directories are not detected by git and hence not
855tracked when committing to SVN. I do not plan on adding support for
856this as it's quite difficult and time-consuming to get working for all
Junio C Hamano00cb3712007-02-23 11:13:52857the possible corner cases (git doesn't do it, either). Committing
Junio C Hamanob77f8192011-05-05 01:30:38858renamed and copied files is fully supported if they're similar enough
Junio C Hamano00cb3712007-02-23 11:13:52859for git to detect them.
860
861CONFIGURATION
862-------------
863
Junio C Hamano48bc1ce2009-07-09 16:49:19864'git svn' stores [svn-remote] configuration information in the
Junio C Hamano00cb3712007-02-23 11:13:52865repository .git/config file. It is similar the core git
866[remote] sections except 'fetch' keys do not accept glob
867arguments; but they are instead handled by the 'branches'
868and 'tags' keys. Since some SVN repositories are oddly
869configured with multiple projects glob expansions such those
870listed below are allowed:
871
872------------------------------------------------------------------------
873[svn-remote "project-a"]
874url = http://server.org/svn
Junio C Hamano9572e922009-04-02 06:52:03875fetch = trunk/project-a:refs/remotes/project-a/trunk
Junio C Hamano00cb3712007-02-23 11:13:52876branches = branches/*/project-a:refs/remotes/project-a/branches/*
877tags = tags/*/project-a:refs/remotes/project-a/tags/*
Junio C Hamano00cb3712007-02-23 11:13:52878------------------------------------------------------------------------
879
Junio C Hamano07738342009-04-23 03:06:56880Keep in mind that the '\*' (asterisk) wildcard of the local ref
Junio C Hamano7d9e9bd2007-08-29 07:31:47881(right of the ':') *must* be the farthest right path component;
Junio C Hamano07738342009-04-23 03:06:56882however the remote wildcard may be anywhere as long as it's an
Junio C Hamanoa6387422007-08-25 03:54:27883independent path component (surrounded by '/' or EOL). This
Junio C Hamano00cb3712007-02-23 11:13:52884type of configuration is not automatically created by 'init' and
Junio C Hamano48bc1ce2009-07-09 16:49:19885should be manually entered with a text-editor or using 'git config'.
Junio C Hamano9ae1a062006-07-10 08:12:34886
Junio C Hamanod0d892c2010-01-24 20:06:29887It is also possible to fetch a subset of branches or tags by using a
888comma-separated list of names within braces. For example:
889
890------------------------------------------------------------------------
891[svn-remote "huge-project"]
892url = http://server.org/svn
893fetch = trunk/src:refs/remotes/trunk
894branches = branches/{red,green}/src:refs/remotes/branches/*
895tags = tags/{1.0,2.0}/src:refs/remotes/tags/*
896------------------------------------------------------------------------
897
898Note that git-svn keeps track of the highest revision in which a branch
899or tag has appeared. If the subset of branches or tags is changed after
900fetching, then .git/svn/.metadata must be manually edited to remove (or
901reset) branches-maxRev and/or tags-maxRev as appropriate.
902
Junio C Hamano6b2cee12006-08-26 08:43:31903SEE ALSO
904--------
Junio C Hamano35738e82008-01-07 07:55:46905linkgit:git-rebase[1]
Junio C Hamano6b2cee12006-08-26 08:43:31906
Junio C Hamano5f3d8392011-03-15 23:33:35907GIT
908---
909Part of the linkgit:git[1] suite