GIT\-SVNIMPORTSection: Git Manual (1)
Index Return to Main Contents
NAMEgit-svnimport - Import a SVN repository into git
git-svnimport [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ] [ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev] [ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ] [ -s start_chg ] [ -m ] [ -r ] [ -M regex ] [ -I <ignorefile_name> ] [ -A <author_file> ] [ -R <repack_each_revs>] [ -P <path_from_trunk> ] <SVN_repository_URL> [ <path> ]
DESCRIPTIONImports a SVN repository into git. It will either create a new repository, or incrementally import into an existing one.
SVN access is done by the SVN::Perl module.
git-svnimport assumes that SVN repositories are organized into one "trunk" directory where the main development happens, "branches/FOO" directories for branches, and "/tags/FOO" directories for tags. Other subdirectories are ignored.
- The GIT repository to import to. If the directory doesn't exist, it will be created. Default is the current directory.
Start importing at this SVN change number. The default is 1.
When importing incrementally, you might need to edit the .git/svn2git file.
- Import-only: don't perform a checkout after importing. This option ensures the working directory and index remain untouched and will not create them if they do not exist.
- Name the SVN trunk. Default "trunk".
- Name the SVN subdirectory for tags. Default "tags".
- Name the SVN subdirectory for branches. Default "branches".
- The trunk branch from SVN is imported to the origin branch within the git repository. Use this option if you want to import into a different branch.
- Prepend rX: to commit messages, where X is the imported subversion revision.
- Replace underscores in tag names with periods.
- Import the svn:ignore directory property to files with this name in each directory. (The Subversion and GIT ignore syntaxes are similar enough that using the Subversion patterns directly with "-I .gitignore" will almost always just work.)
Read a file with lines on the form
.ft C username = User's Full Name <firstname.lastname@example.org> .ft
For convenience, this data is saved to $GIT_DIR/svn-authors each time the -A option is provided, and read from that same file each time git-svnimport is run with an existing GIT repository without -A.
- Attempt to detect merges based on the commit message. This option will enable default regexes that try to capture the name source branch name from the commit message.
- Attempt to detect merges based on the commit message with a custom regex. It can be used with -m to also see the default regexes. You must escape forward slashes.
Specify a maximum revision number to pull.
Formerly, this option controlled how many revisions to pull, due to SVN memory leaks. (These have been worked around.)
Specify how often git repository should be repacked.
The default value is 1000. git-svnimport will do import in chunks of 1000 revisions, after each chunk git repository will be repacked. To disable this behavior specify some big value here which is mote than number of revisions to import.
Partial import of the SVN tree.
By default, the whole tree on the SVN trunk (/trunk) is imported. -P my/proj will import starting only from /trunk/my/proj. This option is useful when you want to import one project from a svn repo which hosts multiple projects under the same trunk.
- Verbosity: let svnimport report what it is doing.
- Use direct HTTP requests if possible. The "<path>" argument is used only for retrieving the SVN logs; the path to the contents is included in the SVN log.
Use direct HTTP requests if possible. The "<path>" argument is used for retrieving the logs, as well as for the contents.
There's no safe way to automatically find out which of these options to use, so you need to try both. Usually, the one that's wrong will die with a 40x error pretty quickly.
The URL of the SVN module you want to import. For local repositories, use "file:///absolute/path".
If you're using the "-d" or "-D" option, this is the URL of the SVN repository itself; it usually ends in "/svn".
- The path to the module you want to check out.
- Print a short usage message and exit.
OUTPUTIf -v is specified, the script reports what it is doing.
AUTHORWritten by Matthias Urlichs <email@example.com>, with help from various participants of the git-list <firstname.lastname@example.org>.
DOCUMENTATIONDocumentation by Matthias Urlichs <email@example.com>.
GITPart of the git(7) suite