Run the command below on behalf of the same user you use to serve Git repository:
$ subgit configure --layout auto --trunk TRUNK SVN_URL GIT_REPO |
where
SVN_URL –
URL to the SVN project.GIT_REPO –
a path to the new Git repository where data from the SVN project will be imported to.TRUNK –
a path, relative to SVN_URL
, that leads to an SVN directory that plays the role of the main line of development.
|
Enable post-receive hook:
$ git config -f GIT_REPO/subgit/config svn.triggerSvnPostReceive true |
where
GIT_REPO –
a path to the new Git repository where data from the SVN project will be imported to.Specify authors mapping
Configure authors mapping in default authors mapping file:
GIT_REPO/subgit/authors.txt |
Or change core.authors
option so that it points to the global authors mapping file.
Find more details about authors mapping in the Authors mapping article.
Specify a username and password that are used by SubGit to access the SCN repository. Edit passwd file:
GIT_REPO/subgit/passwd |
By default, there's only subgit secret credential pair. Replace it with a username and its corresponding password.
There are several methods to configure authentication to access SVN server, but we use a plain text password file here to simplify the guide. See more authentication methods in SVN Authentication if this method does not fit your needs. |
Perform SubGit installation into local Git repository:
$ subgit install GIT_REPO |
where GIT_REPO –
a path to the new Git repository where data from the SVN project will be imported to.
|
step into newly created local Git repository
$ cd GIT_REPO |
add a remote to the local Git repository:
$ git remote add github GITHUB_REPO |
where
GITHUB_REPO
– GitHub project URL.in Linux:
$ git config --global credential.helper cache |
in MacOS X:
$ git config --global credential.helper osxkeychain |
push local repository content into GitHub repository:
|
|
create post-receive hook script and make it executable:
$ echo 'git push --all --follow-tags github' > GIT_REPO/hooks/user-post-receive $ chmod ug+x GIT_REPO/hooks/user-post-receive |
In order to maintain a reliable two-way mirror using the setup described above, Git users have to push their changes to the SubGit-managed Git repository rather than submitting changes to the GitHub repository directly. If nevertheless you need to fetch changes from GitHub - follow the instruction in the GitHub mirror full guide. |
Try and buy.
Note: the trial period for SubGit mirror is 30 days, after that period you should buy a license key at https://subgit.com/pricing. |
Once you receive an email with a license key, upload this license key to your server and run the following command:
$ sudo subgit register --key subgit.key GIT_REPO |
where
GIT_REPO
– a path to your newly created Git repository.
|
Should you need any assistance, don't hesitate to contact us at support@tmatesoft.com.