Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »


## SubGit IMPORT to Linux Gerrit server

1. Configure Gerrit server:

- Log in to console on Gerrit server (over ssh or to the local console) and download SubGit plugin:

[SubGit plugin for Gerrit server](https://subgit.com/download/subgit-gerrit-plugin-1.0.0-EAP4.jar)

MD5 checksum: 3902cf714c856524e8f4815ad70c00f3

***see command example --> (to be placed in drop-down block):***

$ wget https://subgit.com/download/subgit-gerrit-plugin-1.0.0-EAP4.jar

--2017-05-11 18:15:37-- https://subgit.com/download/subgit-gerrit-plugin-1.0.0-EAP4.jar
Resolving subgit.com (subgit.com)... 138.201.118.241
Connecting to subgit.com (subgit.com)|138.201.118.241|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9709051 (9.3M) [application/java-archive]
Saving to: ‘subgit-gerrit-plugin-1.0.0-EAP4.jar’

100%[============================================================================================================>] 9,709,051 814KB/s in 10s

2017-05-11 18:15:48 (938 KB/s) - ‘subgit-gerrit-plugin-1.0.0-EAP4.jar’ saved [9709051/9709051]

- Move downloaded file into GERRIT_SITE/plugins/ directory:

$ mv ./subgit-gerrit-plugin-1.0.0-EAP4.jar GERRIT_SITE/plugins

> **To be added into pop-up cloud (when hovering on GERRIT_SITE):**
>
> **GERRIT_SITE** - the directory that was used as '$site_path' during Gerrit installation.

- Open **GERRIT_SITE/etc/gerrit.config** file and set `receive.timeout` to 0:

[receive]
timeout = 0

if you have Git installed on this machine, it can be done by the following command:

$ git config -f GERRIT_SITE/etc/gerrit.config receive.timeout 0

> **To be added into pop-up cloud (when hovering on GERRIT_SITE):**
>
> **GERRIT_SITE** - the directory that was used as '$site_path' during Gerrit installation.

- Restart Gerrit daemon:

$ GERRIT_SITE/bin/gerrit.sh restart

> **To be added into pop-up cloud (when hovering on GERRIT_SITE):**
>
> **GERRIT_SITE** - the directory that was used as '$site_path' during Gerrit installation.

***see command example --> (to be placed in drop-down block):***

$ /gerrit/bin/gerrit.sh restart
Stopping Gerrit Code Review: OK
Starting Gerrit Code Review: OK

- Check SubGit plugin is showed in Gerrit:

![SubGit plugin for Gerrit server](Gerrit - Plugins.png)

- Create empty Git repository at Projects | Create New Project:

![Create new Gerrit project](Gerrit - NewProject.png)

- Install SubGit binary:

- On non-Debian based Linux download universal **subgit-3.2.4.zip** binary:

https://subgit.com/download/subgit-3.2.4.zip

and unzip it:

$ unzip subgit-3.2.4.zip

- on Debian and Ubuntu download Debian package:

https://subgit.com/download/subgit_3.2.4_all.deb

fetch missing dependencies and install:

$ sudo dpkg -i subgit_3.2.4_all.deb
$ sudo apt-get install -f

2. Configure the repository:

- Return to Gerrit server console and step into 'git' directory within GERRIT_SITE:

$ cd GERRIT_SITE/git

> **To be added into pop-up cloud (when hovering on GERRIT_SITE):**
>
> **GERRIT_SITE** - the directory that was used as '$site_path' during Gerrit installation.

newly created project directory should be present here and named <given project name>.git

***see command example --> (to be placed in drop-down block):***

$ ls -l
drwxr-xr-x. 7 root root 100 May 10 12:00 All-Projects.git
drwxr-xr-x. 7 root root 100 May 10 12:00 All-Users.git
drwxr-xr-x. 7 root root 100 May 11 19:26 project.git

- Run this command to configure SubGit import:

$ subgit-3.2.4/bin/subgit configure --layout auto --trunk trunk SVN_URL GIT_REPO

> **To be added into pop-up cloud (when hovering on SVN_URL and GIT_REPO):**
>
> **SVN_URL** - URL to the SVN project.
>
> **GIT_REPO** - path to newly created Git repository directory where data from the SVN project will be imported to.

***see command example --> (to be placed in drop-down block):***

$ subgit-3.2.4/bin/subgit configure --layout auto --trunk trunk http://svn.example.com/svn/repository/project ./project.git

SubGit version 3.2.4 ('Bobique') build #3670

Configuring writable Git mirror of remote Subversion repository:
Subversion repository URL : http://svn.example.com/svn/repository/project
Git repository location : ./project.git

Git repository is served by GitLab, hooks will be installed into 'custom_hooks' directory.

Detecting peg location...
Authentication realm: <http://svn.example.com/:80> Subversion Repository
Username [git]: user
Password for 'user':
Peg location detected: r10248 project/trunk
Fetching SVN history... Done.
Growing trees... Done.
Project origin detected: r1 project/trunk
Building branches layouts... Done.
Combing beards... Done.
Generating SVN to Git mapping... Done.

CONFIGURATION SUCCESSFUL

To complete SubGit installation do the following:

1) Adjust Subversion to Git branches mapping if necessary:
/var/opt/gitlab/git-data/repositories/user/project.git/subgit/config
2) Define at least one Subversion credentials in default SubGit passwd file at:
/var/opt/gitlab/git-data/repositories/user/project.git/subgit/passwd
OR configure SSH or SSL credentials in the [auth] section of:
/var/opt/gitlab/git-data/repositories/user/project.git/subgit/config
3) Optionally, add custom authors mapping to the authors.txt file(s) at:
/var/opt/gitlab/git-data/repositories/user/project.git/subgit/authors.txt
4) Run SubGit 'install' command:
subgit install ./project.git

- Specify authors mapping

Update GIT_REPOS/subgit/authors.txt file or change core.authors option to point to global authors mapping

Find more details about authors mapping in [Import book](https://subgit.com/import-book.html#20)

3. Perform import and start using new Git repository:

- Import repository by the command:

$ subgit-3.2.4/bin/subgit import GIT_REPO

***see command example --> (to be placed in drop-down block):***

$ subgit-3.2.4/bin/subgit import ./project.git

SubGit version 3.2.4 ('Bobique') build #3670

Authentication realm: <http://svn.example.com:80> Subversion Repository
Username [git]: user
Password for 'user':

Translating Subversion revisions to Git commits...

Subversion revisions translated: 10248.
Total time: 2 hours 15 minutes 38 seconds.

IMPORT SUCCESSFUL

- When the command completes, you can clone your new Git repository and start to work with it:

$ git clone GIT_REPO WORK_TREE

where

**WORK_TREE** - path to your working copy.

**GIT_REPO** - Gerrit project URL

***see command example --> (to be placed in drop-down block):***

$ git clone http://gerrit.example.com/user/project.git ./project.git
Cloning into './project.git'...
Password for 'http://user@example.com':
remote: Counting objects: 99, done.
remote: Compressing objects: 100% (39/39), done.
remote: Total 99 (delta 50), reused 99 (delta 50)
Unpacking objects: 100% (99/99), done.

Note: no license key required for import!

Would you have any assistance, don't hesitate to contact us at support@subgit.com


  • No labels