Merge branch 'lt/rev-list' into next
[git.git] / Documentation / git-svnimport.txt
1 git-svnimport(1)
2 ================
3 v0.1, July 2005
4
5 NAME
6 ----
7 git-svnimport - Import a SVN repository into git
8
9
10 SYNOPSIS
11 --------
12 'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
13                 [ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]
14                 [ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]
15                 [ -s start_chg ] [ -m ] [ -r ] [ -M regex ]
16                 [ -I <ignorefile_name> ] [ -A <author_file> ]
17                 <SVN_repository_URL> [ <path> ]
18
19
20 DESCRIPTION
21 -----------
22 Imports a SVN repository into git. It will either create a new
23 repository, or incrementally import into an existing one.
24
25 SVN access is done by the SVN::Perl module.
26
27 git-svnimport assumes that SVN repositories are organized into one
28 "trunk" directory where the main development happens, "branch/FOO"
29 directories for branches, and "/tags/FOO" directories for tags.
30 Other subdirectories are ignored.
31
32 git-svnimport creates a file ".git/svn2git", which is required for
33 incremental SVN imports.
34
35 OPTIONS
36 -------
37 -C <target-dir>::
38         The GIT repository to import to.  If the directory doesn't
39         exist, it will be created.  Default is the current directory.
40
41 -s <start_rev>::
42         Start importing at this SVN change number. The  default is 1.
43 +
44 When importing incrementally, you might need to edit the .git/svn2git file.
45
46 -i::
47         Import-only: don't perform a checkout after importing.  This option
48         ensures the working directory and index remain untouched and will
49         not create them if they do not exist.
50
51 -T <trunk_subdir>::
52         Name the SVN trunk. Default "trunk".
53
54 -t <tag_subdir>::
55         Name the SVN subdirectory for tags. Default "tags".
56
57 -b <branch_subdir>::
58         Name the SVN subdirectory for branches. Default "branches".
59
60 -o <branch-for-HEAD>::
61         The 'trunk' branch from SVN is imported to the 'origin' branch within
62         the git repository. Use this option if you want to import into a
63         different branch.
64
65 -r::
66         Prepend 'rX: ' to commit messages, where X is the imported
67         subversion revision.
68
69 -I <ignorefile_name>::
70         Import the svn:ignore directory property to files with this
71         name in each directory. (The Subversion and GIT ignore
72         syntaxes are similar enough that using the Subversion patterns
73         directly with "-I .gitignore" will almost always just work.)
74
75 -A <author_file>::
76         Read a file with lines on the form
77
78           username = User's Full Name <email@addr.es>
79
80         and use "User's Full Name <email@addr.es>" as the GIT
81         author and committer for Subversion commits made by
82         "username". If encountering a commit made by a user not in the
83         list, abort.
84
85         For convenience, this data is saved to $GIT_DIR/svn-authors
86         each time the -A option is provided, and read from that same
87         file each time git-svnimport is run with an existing GIT
88         repository without -A.
89
90 -m::
91         Attempt to detect merges based on the commit message. This option
92         will enable default regexes that try to capture the name source
93         branch name from the commit message.
94
95 -M <regex>::
96         Attempt to detect merges based on the commit message with a custom
97         regex. It can be used with -m to also see the default regexes.
98         You must escape forward slashes.
99
100 -l <max_rev>::
101         Specify a maximum revision number to pull.
102
103         Formerly, this option controlled how many revisions to pull,
104         due to SVN memory leaks. (These have been worked around.)
105
106 -v::
107         Verbosity: let 'svnimport' report what it is doing.
108
109 -d::
110         Use direct HTTP requests if possible. The "<path>" argument is used
111         only for retrieving the SVN logs; the path to the contents is
112         included in the SVN log.
113
114 -D::
115         Use direct HTTP requests if possible. The "<path>" argument is used
116         for retrieving the logs, as well as for the contents.
117 +
118 There's no safe way to automatically find out which of these options to
119 use, so you need to try both. Usually, the one that's wrong will die
120 with a 40x error pretty quickly.
121
122 <SVN_repository_URL>::
123         The URL of the SVN module you want to import. For local
124         repositories, use "file:///absolute/path".
125 +
126 If you're using the "-d" or "-D" option, this is the URL of the SVN
127 repository itself; it usually ends in "/svn".
128
129 <path>::
130         The path to the module you want to check out.
131
132 -h::
133         Print a short usage message and exit.
134
135 OUTPUT
136 ------
137 If '-v' is specified, the script reports what it is doing.
138
139 Otherwise, success is indicated the Unix way, i.e. by simply exiting with
140 a zero exit status.
141
142 Author
143 ------
144 Written by Matthias Urlichs <smurf@smurf.noris.de>, with help from
145 various participants of the git-list <git@vger.kernel.org>.
146
147 Based on a cvs2git script by the same author.
148
149 Documentation
150 --------------
151 Documentation by Matthias Urlichs <smurf@smurf.noris.de>.
152
153 GIT
154 ---
155 Part of the gitlink:git[7] suite
156