How to migrate a Gitolite repository to GitLab

1 min readAug 17, 2019

If you would like to migrate from Gitolite to GitLab, follow the steps below:

Migrate from Gitolite to GitLab
  1. First, on your local machine, clone the repository you want to migrate.
$ git clone —-mirror ssh://git@my_server:2222/my_repository

2. Go inside your repository

$ cd my_repository

3. Quickly check remote origin values (to make sure it show Gitolite server)

$ git remote -v

4. Remove the remote origin values and set value to new repository

As a pre-requisites here, you need to make sure you’ve already created your new repository in Gitlab. Mine is ‘my_gitlab_repo’.

$ git remote rm origin
$ git remote add origin git@my_gitlab_url:my_user/my_gitlab_repo.git

5. To be sure it’s set correctly, check remote origin value

$ git remote -v

You should see something like:

origin git@my_gitlab_url:my_user/my_gitlab_repo.git (fetch)origin git@my_gitlab_url:my_user/my_gitlab_repo.git (push)

6. Last step, push now everything to GitLab repository.

$ git push -u origin --all