...
All the mapping settings reside in [svn] configurations section. There are three main settings groups:
...
- SVN project location:
...
- url - a URL leading to the SVN project.
...
- Branches and tags mapping rules:
- trunk - a path, relative to the URL, that leads to project's trunk.
...
- branches - a relative path to a directory, containing branches, or a path to a particular branch.
...
- tags - a relative path to a directory, containing tags, or a path to a particular tag.
...
- shelves - a relative path to a directory, where *shelves* will be kept.
- shelves - a relative path to a directory, where *shelves* will be kept.
...
- Refining mapping rules:
...
- excludeBranches - a relative path or path pattern with one wildcard, that point to branches or tags, that should be excluded from translation.
...
- excludeTags - same as
...
- excludeBranches
...
- .
...
- excludePath - an expression, representing files to be excluded from the translation.
...
- includePath - an expression, representing files to be included in the translation.
svn.url
This option sets a URL to the SVN project, that is being translated into Git repository. SubGit translates a SVN project into a Git repository: not whole SVN repository to Git repository:
Thus, the `svn.url` setting is supposed to point to your SVN project root, not to SVN repository root; i.e., if you want to mirror, say, 'project1' to Git, then the svn.url must be set as follows:
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
[svn]
url = http://example.com/svn/repository/project1 |
Most of the mapping settings rely on this path and their values are being set relative to this project root.
SubGit support all protocols SVN supports, so the svn.url can be set using the following protocol prefixes:
file:///svn://svn+ssh://http://https://
Mapping settings
The next four options – trunk, branches, tags, shelves – actually tell SubGit how SVN to Git entities match to each other. Generic mapping syntax is:
| Code Block | ||||||
|---|---|---|---|---|---|---|
| ||||||
<Mapping-option> = <Subversion-Path-Pattern>:<Git-Reference-Pattern> |
where
- Mapping-option - essentially, a mapping option: trunk, branches, tags or shelves.
- Subversion-Path-Pattern – a SVN directory path relative to `svn.url`.
- Git-Reference-Pattern – a path inside Git repository where references will be stored.
svn.trunk
This setting establishes a correspondence between SVN *trunk* and Git branch that represents the main line of development. Assuming, that SVN "main line of development" is being kept in a directory named 'trunk' and Git 'master' branch represents the "main line" in Git, the mapping may look like this:
trunk = trunk:refs/heads/master
where
- the first trunk is a mapping option name, determining which entity is being mapped.
- the second trunk is a path to SVN directory, which plays a role of trunk. This path is relative to specified `svn.url`, i.e. the full path to that directory consists of the URL and this path. Thus, suppose the URL is set like follows:
url = http://example.com/svn/repository/Project1
In this case, the full path to the SVN *trunk* is equal to this:
http://example.com/svn/repository/Project1/trunk
- *refs/heads/master* - a path in Git repository, where the *branch* reference is kept. In this case, SVN *trunk* is being translated into Git *master* branch.
There are few rules that apply to the `svn.trunk` option:
>- ***trunk*** must be mapped; the only exclusion is the configuration with no defined mapping - no trunk, branches, tags and shelves options at all - that may be used to import SVN projects with no branches.
>- there must be only one ***trunk*** mapping.
>- ***trunk*** cannot contain wildcards.
