]>
Commit | Line | Data |
---|---|---|
eaf718f3 MU |
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 | -------- | |
c7569b1e | 12 | [verse] |
25f6f325 | 13 | 'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ] |
525c0d71 KW |
14 | [ -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 ] | |
36610b24 | 17 | [ -I <ignorefile_name> ] [ -A <author_file> ] |
40006ea0 | 18 | [ -R <repack_each_revs>] [ -P <path_from_trunk> ] |
36610b24 | 19 | <SVN_repository_URL> [ <path> ] |
eaf718f3 MU |
20 | |
21 | ||
22 | DESCRIPTION | |
23 | ----------- | |
24 | Imports a SVN repository into git. It will either create a new | |
25 | repository, or incrementally import into an existing one. | |
26 | ||
e72c9f5c | 27 | SVN access is done by the SVN::Perl module. |
eaf718f3 MU |
28 | |
29 | git-svnimport assumes that SVN repositories are organized into one | |
30 | "trunk" directory where the main development happens, "branch/FOO" | |
31 | directories for branches, and "/tags/FOO" directories for tags. | |
32 | Other subdirectories are ignored. | |
33 | ||
34 | git-svnimport creates a file ".git/svn2git", which is required for | |
29504118 | 35 | incremental SVN imports. |
eaf718f3 MU |
36 | |
37 | OPTIONS | |
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 | ||
7ee74a99 MU |
43 | -s <start_rev>:: |
44 | Start importing at this SVN change number. The default is 1. | |
45 | + | |
89438677 | 46 | When importing incrementally, you might need to edit the .git/svn2git file. |
7ee74a99 | 47 | |
eaf718f3 MU |
48 | -i:: |
49 | Import-only: don't perform a checkout after importing. This option | |
5f3aa197 | 50 | ensures the working directory and index remain untouched and will |
eaf718f3 MU |
51 | not create them if they do not exist. |
52 | ||
2ed8e622 | 53 | -T <trunk_subdir>:: |
eaf718f3 | 54 | Name the SVN trunk. Default "trunk". |
29504118 | 55 | |
2ed8e622 | 56 | -t <tag_subdir>:: |
eaf718f3 | 57 | Name the SVN subdirectory for tags. Default "tags". |
29504118 | 58 | |
eaf718f3 MU |
59 | -b <branch_subdir>:: |
60 | Name the SVN subdirectory for branches. Default "branches". | |
29504118 | 61 | |
eaf718f3 MU |
62 | -o <branch-for-HEAD>:: |
63 | The 'trunk' branch from SVN is imported to the 'origin' branch within | |
64 | the git repository. Use this option if you want to import into a | |
65 | different branch. | |
66 | ||
0a48a344 KW |
67 | -r:: |
68 | Prepend 'rX: ' to commit messages, where X is the imported | |
69 | subversion revision. | |
70 | ||
c55f3fff KW |
71 | -I <ignorefile_name>:: |
72 | Import the svn:ignore directory property to files with this | |
73 | name in each directory. (The Subversion and GIT ignore | |
74 | syntaxes are similar enough that using the Subversion patterns | |
75 | directly with "-I .gitignore" will almost always just work.) | |
76 | ||
36610b24 KW |
77 | -A <author_file>:: |
78 | Read a file with lines on the form | |
3070b603 FD |
79 | + |
80 | ------ | |
81 | username = User's Full Name <email@addr.es> | |
36610b24 | 82 | |
3070b603 FD |
83 | ------ |
84 | + | |
85 | and use "User's Full Name <email@addr.es>" as the GIT | |
86 | author and committer for Subversion commits made by | |
87 | "username". If encountering a commit made by a user not in the | |
88 | list, abort. | |
89 | + | |
90 | For convenience, this data is saved to $GIT_DIR/svn-authors | |
91 | each time the -A option is provided, and read from that same | |
92 | file each time git-svnimport is run with an existing GIT | |
93 | repository without -A. | |
d3cac2c9 | 94 | |
29504118 | 95 | -m:: |
eaf718f3 | 96 | Attempt to detect merges based on the commit message. This option |
29504118 JH |
97 | will enable default regexes that try to capture the name source |
98 | branch name from the commit message. | |
eaf718f3 MU |
99 | |
100 | -M <regex>:: | |
101 | Attempt to detect merges based on the commit message with a custom | |
29504118 JH |
102 | regex. It can be used with -m to also see the default regexes. |
103 | You must escape forward slashes. | |
eaf718f3 | 104 | |
03490804 MU |
105 | -l <max_rev>:: |
106 | Specify a maximum revision number to pull. | |
ee6002aa JH |
107 | + |
108 | Formerly, this option controlled how many revisions to pull, | |
109 | due to SVN memory leaks. (These have been worked around.) | |
3ef378a6 | 110 | |
40006ea0 SK |
111 | -R <repack_each_revs>:: |
112 | Specify how often git repository should be repacked. | |
113 | + | |
114 | The default value is 1000. git-svnimport will do import in chunks of 1000 | |
115 | revisions, after each chunk git repository will be repacked. To disable | |
116 | this behavior specify some big value here which is mote than number of | |
117 | revisions to import. | |
118 | ||
c0e9232e QT |
119 | -P <path_from_trunk>:: |
120 | Partial import of the SVN tree. | |
ee6002aa JH |
121 | + |
122 | By default, the whole tree on the SVN trunk (/trunk) is imported. | |
123 | '-P my/proj' will import starting only from '/trunk/my/proj'. | |
124 | This option is useful when you want to import one project from a | |
125 | svn repo which hosts multiple projects under the same trunk. | |
c0e9232e | 126 | |
eaf718f3 MU |
127 | -v:: |
128 | Verbosity: let 'svnimport' report what it is doing. | |
129 | ||
25f6f325 MU |
130 | -d:: |
131 | Use direct HTTP requests if possible. The "<path>" argument is used | |
132 | only for retrieving the SVN logs; the path to the contents is | |
133 | included in the SVN log. | |
134 | ||
135 | -D:: | |
136 | Use direct HTTP requests if possible. The "<path>" argument is used | |
137 | for retrieving the logs, as well as for the contents. | |
138 | + | |
139 | There's no safe way to automatically find out which of these options to | |
140 | use, so you need to try both. Usually, the one that's wrong will die | |
141 | with a 40x error pretty quickly. | |
142 | ||
eaf718f3 MU |
143 | <SVN_repository_URL>:: |
144 | The URL of the SVN module you want to import. For local | |
145 | repositories, use "file:///absolute/path". | |
25f6f325 MU |
146 | + |
147 | If you're using the "-d" or "-D" option, this is the URL of the SVN | |
148 | repository itself; it usually ends in "/svn". | |
149 | ||
e72c9f5c | 150 | <path>:: |
25f6f325 | 151 | The path to the module you want to check out. |
eaf718f3 MU |
152 | |
153 | -h:: | |
154 | Print a short usage message and exit. | |
155 | ||
156 | OUTPUT | |
157 | ------ | |
158 | If '-v' is specified, the script reports what it is doing. | |
159 | ||
160 | Otherwise, success is indicated the Unix way, i.e. by simply exiting with | |
161 | a zero exit status. | |
162 | ||
163 | Author | |
164 | ------ | |
165 | Written by Matthias Urlichs <smurf@smurf.noris.de>, with help from | |
166 | various participants of the git-list <git@vger.kernel.org>. | |
167 | ||
168 | Based on a cvs2git script by the same author. | |
169 | ||
170 | Documentation | |
171 | -------------- | |
172 | Documentation by Matthias Urlichs <smurf@smurf.noris.de>. | |
173 | ||
174 | GIT | |
175 | --- | |
176 | Part of the gitlink:git[7] suite | |
177 |