1git-svnimport(1) 2================ 3v0.1, July 2005 4 5NAME 6---- 7git-svnimport - Import a SVN repository into git 8 9 10SYNOPSIS 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 20DESCRIPTION 21----------- 22Imports a SVN repository into git. It will either create a new 23repository, or incrementally import into an existing one. 24 25SVN access is done by the SVN::Perl module. 26 27git-svnimport assumes that SVN repositories are organized into one 28"trunk" directory where the main development happens, "branch/FOO" 29directories for branches, and "/tags/FOO" directories for tags. 30Other subdirectories are ignored. 31 32git-svnimport creates a file ".git/svn2git", which is required for 33incremental SVN imports. 34 35OPTIONS 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+ 44When 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-m:: 86 Attempt to detect merges based on the commit message. This option 87 will enable default regexes that try to capture the name source 88 branch name from the commit message. 89 90-M <regex>:: 91 Attempt to detect merges based on the commit message with a custom 92 regex. It can be used with -m to also see the default regexes. 93 You must escape forward slashes. 94 95-l <max_rev>:: 96 Specify a maximum revision number to pull. 97 98 Formerly, this option controlled how many revisions to pull, 99 due to SVN memory leaks. (These have been worked around.) 100 101-v:: 102 Verbosity: let 'svnimport' report what it is doing. 103 104-d:: 105 Use direct HTTP requests if possible. The "<path>" argument is used 106 only for retrieving the SVN logs; the path to the contents is 107 included in the SVN log. 108 109-D:: 110 Use direct HTTP requests if possible. The "<path>" argument is used 111 for retrieving the logs, as well as for the contents. 112+ 113There's no safe way to automatically find out which of these options to 114use, so you need to try both. Usually, the one that's wrong will die 115with a 40x error pretty quickly. 116 117<SVN_repository_URL>:: 118 The URL of the SVN module you want to import. For local 119 repositories, use "file:///absolute/path". 120+ 121If you're using the "-d" or "-D" option, this is the URL of the SVN 122repository itself; it usually ends in "/svn". 123 124<path>:: 125 The path to the module you want to check out. 126 127-h:: 128 Print a short usage message and exit. 129 130OUTPUT 131------ 132If '-v' is specified, the script reports what it is doing. 133 134Otherwise, success is indicated the Unix way, i.e. by simply exiting with 135a zero exit status. 136 137Author 138------ 139Written by Matthias Urlichs <smurf@smurf.noris.de>, with help from 140various participants of the git-list <git@vger.kernel.org>. 141 142Based on a cvs2git script by the same author. 143 144Documentation 145-------------- 146Documentation by Matthias Urlichs <smurf@smurf.noris.de>. 147 148GIT 149--- 150Part of the gitlink:git[7] suite 151