- Install SubGit tool according to the Installation guide.
- Configure GitHub
- login to GitHub and create a new repository:
- login to GitHub and create a new repository:
- Configure local repository:
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 toSVN_URL
, that leads to an SVN directory that plays a 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 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 username and its corresponding password.
SVN authentication
There are several methods to configure authentication to access SVN server, but we use 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.- Sync local Git repository with GitHub:
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.
- enable caching your GitHub password in Git:
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
Mirroring limitation
In order to maintain reliable two-way mirror using setup described above, Git users have to push their changes to SubGit-managed Git repository rather than submitting changes to GitHub repository directly. If neverthelessyou need to fetch changes from GitHub - follow the instruction in GitHub mirror full guide.
Try and buy.
Trial period
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.- Get support.
Have you faced with any problems, see the following guide for more details:
Would you have any assistance, don't hesitate to contact us at support@subgit.com.