blob: b166cf3327380a8f386825a7fbce92f2447bb54e [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-svnimport(1)
2================
3v0.1, July 2005
4
5NAME
6----
7git-svnimport - Import a SVN repository into git
8
9
10SYNOPSIS
11--------
Junio C Hamano9c099c82006-03-03 23:19:4812[verse]
Junio C Hamano1a4e8412005-12-27 08:17:2313'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
Junio C Hamano2abe7e82006-02-27 07:07:0814[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]
15[ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]
16[ -s start_chg ] [ -m ] [ -r ] [ -M regex ]
Junio C Hamano93b02f22006-02-28 00:09:5817[ -I <ignorefile_name> ] [ -A <author_file> ]
Junio C Hamano79770b62007-01-07 07:43:5818[ -R <repack_each_revs>] [ -P <path_from_trunk> ]
Junio C Hamano93b02f22006-02-28 00:09:5819<SVN_repository_URL> [ <path> ]
Junio C Hamano1a4e8412005-12-27 08:17:2320
21
22DESCRIPTION
23-----------
24Imports a SVN repository into git. It will either create a new
25repository, or incrementally import into an existing one.
26
Junio C Hamanoa6331a82006-01-22 07:50:3327SVN access is done by the SVN::Perl module.
Junio C Hamano1a4e8412005-12-27 08:17:2328
29git-svnimport assumes that SVN repositories are organized into one
30"trunk" directory where the main development happens, "branch/FOO"
31directories for branches, and "/tags/FOO" directories for tags.
32Other subdirectories are ignored.
33
34git-svnimport creates a file ".git/svn2git", which is required for
35incremental SVN imports.
36
37OPTIONS
38-------
39-C <target-dir>::
40 The GIT repository to import to. If the directory doesn't
41 exist, it will be created. Default is the current directory.
42
43-s <start_rev>::
44 Start importing at this SVN change number. The default is 1.
45+
Junio C Hamano235a91e2006-01-07 01:13:5846When importing incrementally, you might need to edit the .git/svn2git file.
Junio C Hamano1a4e8412005-12-27 08:17:2347
48-i::
49Import-only: don't perform a checkout after importing. This option
50ensures the working directory and index remain untouched and will
51not create them if they do not exist.
52
Junio C Hamano235a91e2006-01-07 01:13:5853-T <trunk_subdir>::
Junio C Hamano1a4e8412005-12-27 08:17:2354Name the SVN trunk. Default "trunk".
55
Junio C Hamano235a91e2006-01-07 01:13:5856-t <tag_subdir>::
Junio C Hamano1a4e8412005-12-27 08:17:2357Name the SVN subdirectory for tags. Default "tags".
58
59-b <branch_subdir>::
60Name the SVN subdirectory for branches. Default "branches".
61
62-o <branch-for-HEAD>::
63The 'trunk' branch from SVN is imported to the 'origin' branch within
64the git repository. Use this option if you want to import into a
65different branch.
66
Junio C Hamanoc9154122006-02-15 02:22:0667-r::
68Prepend 'rX: ' to commit messages, where X is the imported
69subversion revision.
70
Junio C Hamano2abe7e82006-02-27 07:07:0871-I <ignorefile_name>::
72Import the svn:ignore directory property to files with this
73name in each directory. (The Subversion and GIT ignore
74syntaxes are similar enough that using the Subversion patterns
75directly with "-I .gitignore" will almost always just work.)
76
Junio C Hamano93b02f22006-02-28 00:09:5877-A <author_file>::
78Read a file with lines on the form
Junio C Hamanoa725a532006-03-21 08:33:4779+
80------
81username = User's Full Name <email@addr.es>
Junio C Hamano93b02f22006-02-28 00:09:5882
Junio C Hamanoa725a532006-03-21 08:33:4783------
84+
85and use "User's Full Name <email@addr.es>" as the GIT
86author and committer for Subversion commits made by
87"username". If encountering a commit made by a user not in the
88list, abort.
89+
90For convenience, this data is saved to $GIT_DIR/svn-authors
91each time the -A option is provided, and read from that same
92file each time git-svnimport is run with an existing GIT
93repository without -A.
Junio C Hamanoadb91282006-03-02 08:11:4994
Junio C Hamano1a4e8412005-12-27 08:17:2395-m::
96Attempt to detect merges based on the commit message. This option
97will enable default regexes that try to capture the name source
98branch name from the commit message.
99
100-M <regex>::
101Attempt to detect merges based on the commit message with a custom
102regex. It can be used with -m to also see the default regexes.
103You must escape forward slashes.
104
105-l <max_rev>::
106Specify a maximum revision number to pull.
Junio C Hamano1de7bc62006-12-17 19:31:54107+
108Formerly, this option controlled how many revisions to pull,
109due to SVN memory leaks. (These have been worked around.)
Junio C Hamano1a4e8412005-12-27 08:17:23110
Junio C Hamano79770b62007-01-07 07:43:58111-R <repack_each_revs>::
112Specify how often git repository should be repacked.
113+
114The default value is 1000. git-svnimport will do import in chunks of 1000
115revisions, after each chunk git repository will be repacked. To disable
116this behavior specify some big value here which is mote than number of
117revisions to import.
118
Junio C Hamano1de7bc62006-12-17 19:31:54119-P <path_from_trunk>::
120Partial import of the SVN tree.
121+
122By default, the whole tree on the SVN trunk (/trunk) is imported.
123'-P my/proj' will import starting only from '/trunk/my/proj'.
124This option is useful when you want to import one project from a
125svn repo which hosts multiple projects under the same trunk.
Junio C Hamano1a4e8412005-12-27 08:17:23126
127-v::
128Verbosity: let 'svnimport' report what it is doing.
129
130-d::
131Use direct HTTP requests if possible. The "<path>" argument is used
132only for retrieving the SVN logs; the path to the contents is
133included in the SVN log.
134
135-D::
136Use direct HTTP requests if possible. The "<path>" argument is used
137for retrieving the logs, as well as for the contents.
138+
139There's no safe way to automatically find out which of these options to
140use, so you need to try both. Usually, the one that's wrong will die
141with a 40x error pretty quickly.
142
143<SVN_repository_URL>::
144The URL of the SVN module you want to import. For local
145repositories, use "file:///absolute/path".
146+
147If you're using the "-d" or "-D" option, this is the URL of the SVN
148repository itself; it usually ends in "/svn".
149
Junio C Hamanoa6331a82006-01-22 07:50:33150<path>::
Junio C Hamano1a4e8412005-12-27 08:17:23151The path to the module you want to check out.
152
153-h::
154Print a short usage message and exit.
155
156OUTPUT
157------
158If '-v' is specified, the script reports what it is doing.
159
160Otherwise, success is indicated the Unix way, i.e. by simply exiting with
161a zero exit status.
162
163Author
164------
165Written by Matthias Urlichs <smurf@smurf.noris.de>, with help from
166various participants of the git-list <git@vger.kernel.org>.
167
168Based on a cvs2git script by the same author.
169
170Documentation
171--------------
172Documentation by Matthias Urlichs <smurf@smurf.noris.de>.
173
174GIT
175---
176Part of the gitlink:git[7] suite
177