Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
Guides
- gitattributes
- Command-line interface conventions
- Everyday Git
- Frequently Asked Questions (FAQ)
- Glossary
- Hooks
- gitignore
- gitmodules
- Revisions
- Submodules
- Tutorial
- Workflows
- All guides...
Administration
Plumbing Commands
- 2.56.0 no changes
-
2.55.0
2026-06-29
- 2.53.0 → 2.54.0 no changes
-
2.52.0
2025-11-17
- 2.47.1 → 2.51.2 no changes
-
2.47.0
2024-10-06
- 2.44.1 → 2.46.4 no changes
-
2.44.0
2024-02-23
- 2.35.1 → 2.43.7 no changes
-
2.35.0
2022-01-24
- 2.34.1 → 2.34.8 no changes
- 2.34.0 no changes
- 2.32.1 → 2.33.8 no changes
-
2.32.0
2021-06-06
- 2.30.1 → 2.31.8 no changes
-
2.30.0
2020-12-27
- 2.25.1 → 2.29.3 no changes
-
2.25.0
2020-01-13
- 2.24.1 → 2.24.4 no changes
-
2.24.0
2019-11-04
- 2.22.1 → 2.23.4 no changes
-
2.22.0
2019-06-07
- 2.19.1 → 2.21.4 no changes
-
2.19.0
2018-09-10
- 2.18.1 → 2.18.5 no changes
-
2.18.0
2018-06-21
- 2.16.6 → 2.17.6 no changes
-
2.15.4
2019-12-06
-
2.14.6
2019-12-06
- 2.12.5 → 2.13.7 no changes
-
2.11.4
2017-09-22
-
2.10.5
2017-09-22
-
2.9.5
2017-07-30
-
2.8.6
2017-07-30
- 2.6.7 → 2.7.6 no changes
-
2.5.6
2017-05-05
-
2.4.12
2017-05-05
- 2.3.10 no changes
-
2.2.3
2015-09-04
-
2.1.4
2014-12-17
-
2.0.5
2014-12-17
DESCRIPTION
git svn is a simple conduit for changesets between Subversion and Git. It provides a bidirectional flow of changes between a Subversion and a Git repository.
git svn can track a standard Subversion repository, following the common "trunk/branches/tags" layout, with the --stdlayout option. It can also follow branches and tags in any layout with the -T/-t/-b options (see options to init below, and also the clone command).
Once tracking a Subversion repository (with any of the above methods), the Git repository can be updated from Subversion by the fetch command and Subversion updated from Git by the dcommit command.
COMMANDS
- init
-
Initializes an empty Git repository with additional metadata directories for git svn. The Subversion URL may be specified as a command-line argument, or as full URL arguments to -T/-t/-b. Optionally, the target directory to operate on can be specified as a second argument. Normally this command initializes the current directory.
- -T<trunk_subdir>
- --trunk=<trunk_subdir>
- -t<tags_subdir>
- --tags=<tags_subdir>
- -b<branches_subdir>
- --branches=<branches_subdir>
- -s
- --stdlayout
-
These are optional command-line options for init. Each of these flags can point to a relative repository path (--tags=project/tags) or a full url (--tags=https://foo.org/project/tags). You can specify more than one --tags and/or --branches options, in case your Subversion repository places tags or branches under multiple paths. The option --stdlayout is a shorthand way of setting trunk,tags,branches as the relative paths, which is the Subversion default. If any of the other options are given as well, they take precedence.
- --no-metadata
-
Set the noMetadata option in the [svn-remote] config. This option is not recommended, please read the svn.noMetadata section of this manpage before using this option.
- --use-svm-props
-
Set the useSvmProps option in the [svn-remote] config.
- --use-svnsync-props
-
Set the useSvnsyncProps option in the [svn-remote] config.
- --rewrite-root=<URL>
-
Set the rewriteRoot option in the [svn-remote] config.
- --rewrite-uuid=<UUID>
-
Set the rewriteUUID option in the [svn-remote] config.
- --username=<user>
-
For transports that SVN handles authentication for (http, https, and plain svn), specify the username. For other transports (e.g.
svn+ssh://), you must include the username in the URL, e.g.svn+ssh://foo@svn.bar.com/project - --prefix=<prefix>
-
This allows one to specify a prefix which is prepended to the names of remotes if trunk/branches/tags are specified. The prefix does not automatically include a trailing slash, so be sure you include one in the argument if that is what you want. If --branches/-b is specified, the prefix must include a trailing slash. Setting a prefix (with a trailing slash) is strongly encouraged in any case, as your SVN-tracking refs will then be located at "refs/remotes/$prefix/", which is compatible with Git’s own remote-tracking ref layout (refs/remotes/$remote/). Setting a prefix is also useful if you wish to track multiple projects that share a common repository. By default, the prefix is set to origin/.
NoteBefore Git v2.0, the default prefix was "" (no prefix). This meant that SVN-tracking refs were put at "refs/remotes/*", which is incompatible with how Git’s own remote-tracking refs are organized. If you still want the old default, you can get it by passing --prefix""on the command line (--prefix=""may not work if your Perl’s Getopt::Long is < v2.37). - --ignore-paths=<regex>
-
When passed to init or clone this regular expression will be preserved as a config key. See fetch for a description of --ignore-paths.
- --include-paths=<regex>
-
When passed to init or clone this regular expression will be preserved as a config key. See fetch for a description of --include-paths.
- --no-minimize-url
-
When tracking multiple directories (using --stdlayout, --branches, or --tags options), git svn will attempt to connect to the root (or highest allowed level) of the Subversion repository. This default allows better tracking of history if entire projects are moved within a repository, but may cause issues on repositories where read access restrictions are in place. Passing --no-minimize-url will allow git svn to accept URLs as-is without attempting to connect to a higher level directory. This option is off by default when only one URL/branch is tracked (it would do little good).
- fetch
-
Fetch unfetched revisions from the Subversion remote we are tracking. The name of the [svn-remote "…"] section in the $GIT_DIR/config file may be specified as an optional command-line argument.
This automatically updates the rev_map if needed (see $GIT_DIR/svn/*\*/.rev_map.* in the FILES section below for details).
- --localtime
-
Store Git commit times in the local time zone instead of UTC. This makes git log (even without --date=local) show the same times that
svnlogwould in the local time zone.This doesn’t interfere with interoperating with the Subversion repository you cloned from, but if you wish for your local Git repository to be able to interoperate with someone else’s local Git repository, either don’t use this option or you should both use it in the same local time zone.
- --parent
-
Fetch only from the SVN parent of the current HEAD.
- --ignore-paths=<regex>
-
This allows one to specify a Perl regular expression that will cause skipping of all matching paths from checkout from SVN. The --ignore-paths option should match for every fetch (including automatic fetches due to clone, dcommit, rebase, etc) on a given repository.
config key: svn-remote.<name>.ignore-paths
If the ignore-paths configuration key is set, and the command-line option is also given, both regular expressions will be used.
Examples:
- --include-paths=<regex>
-
This allows one to specify a Perl regular expression that will cause the inclusion of only matching paths from checkout from SVN. The --include-paths option should match for every fetch (including automatic fetches due to clone, dcommit, rebase, etc) on a given repository. --ignore-paths takes precedence over --include-paths.
- --log-window-size=<n>
-
Fetch <n> log entries per request when scanning Subversion history. The default is 100. For very large Subversion repositories, larger values may be needed for clone/fetch to complete in reasonable time. But overly large values may lead to higher memory usage and request timeouts.
- clone
-
Runs init and fetch. It will automatically create a directory based on the basename of the URL passed to it; or if a second argument is passed; it will create a directory and work within that. It accepts all arguments that the init and fetch commands accept; with the exception of --fetch-all and --parent. After a repository is cloned, the fetch command will be able to update revisions without affecting the working tree; and the rebase command will be able to update the working tree with the latest changes.
- --preserve-empty-dirs
-
Create a placeholder file in the local Git repository for each empty directory fetched from Subversion. This includes directories that become empty by removing all entries in the Subversion repository (but not the directory itself). The placeholder files are also tracked and removed when no longer necessary.
- --placeholder-filename=<filename>
-
Set the name of placeholder files created by --preserve-empty-dirs. Default: ".gitignore"
- rebase
-
This fetches revisions from the SVN parent of the current HEAD and rebases the current (uncommitted to SVN) work against it.
This works similarly to
svnupdateor git pull except that it preserves linear history with git rebase instead of git merge for ease of dcommitting with git svn.This accepts all options that git svn fetch and git rebase accept. However, --fetch-all only fetches from the current [svn-remote], and not all [svn-remote] definitions.
Like git rebase; this requires that the working tree be clean and have no uncommitted changes.
This automatically updates the rev_map if needed (see $GIT_DIR/svn/*\*/.rev_map.* in the FILES section below for details).
- dcommit
-
Commit each diff from the current branch directly to the SVN repository, and then rebase or reset (depending on whether or not there is a diff between SVN and head). This will create a revision in SVN for each commit in Git.
When an optional Git branch name (or a Git commit object name) is specified as an argument, the subcommand works on the specified branch, not on the current branch.
Use of dcommit is preferred to set-tree (below).
- --no-rebase
-
After committing, do not rebase or reset.
- --commit-url <URL>
-
Commit to this SVN URL (the full path). This is intended to allow existing git svn repositories created with one transport method (e.g.
svn://orhttp://for anonymous read) to be reused if a user is later given access to an alternate transport method (e.g.svn+ssh://orhttps://) for commit.config key: svn-remote.<name>.commiturl config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
Note that the SVN URL of the commiturl config key includes the SVN branch. If you rather want to set the commit URL for an entire SVN repository use svn-remote.<name>.pushurl instead.
Using this option for any other purpose (don’t ask) is very strongly discouraged.
- --mergeinfo=<mergeinfo>
-
Add the given merge information during the dcommit (e.g.
--mergeinfo="/branches/foo:1-10"). All svn server versions can store this information (as a property), and svn clients starting from version 1.5 can make use of it. To specify merge information from multiple branches, use a single space character between the branches (--mergeinfo="/branches/foo:1-10