Run the command below on behalf of the same user you use to serve Git repository:
> subgit.bat 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.bat install GIT_REPO |
where
GIT_REPO –
a path to the new Git repository where data from the SVN project will be imported to.
|
locate the folder where Git for Windows is installed to (usually C:\Program Files\Git
) and open git-bash.exe
:
step into newly created local Git repository
> cd GIT_REPO |
where
GIT_REPO –
a path to the new Git repository where data from the SVN project will be imported to.add a remote to the local Git repository:
> git remote add github GITHUB_REPO |
where
GITHUB_REPO –
GitHub project URL.enable caching your GitHub password in Git:
> git config --global credential.helper wincred |
push local repository content into GitHub repository:
> git push github --all --follow-tags --force |
|
create post-receive hook script and make it executable:
> cp GIT_REPO/hooks/user-post-receive.sample GIT_REPO/hooks/user-post-receive > sed -i -- 's/exit 0/git push --all --follow-tags github/g' 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. |
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 the new Git repository where data from the SVN project will be imported to.
|
Should you need assistance, don't hesitate to contact us at support@tmatesoft.com.