user4948798
user4948798

Reputation: 2102

GitLab server repository movement to gerrit

I have to move one repository from Gitlab server to Gerrit server along with the history, branches and tags etc.

Could you please suggest me the ways to do it.

Upvotes: 3

Views: 1025

Answers (2)

1) Create the repository in Gerrit using the UI (or ask the Gerrit admin to do that)

2) Clone the Gitlab repository using the "--bare" option

git clone --bare GITLAB-URL

3) Add the Gerrit remote

cd REPO-NAME
git remote add gerrit GERRIT-URL

4) Push all commits, branches and tags to Gerrit

git push --all gerrit
git push --tags gerrit

5) Remove the temp repository

cd ..
rm -rf REPO-NAME

Upvotes: 2

VonC
VonC

Reputation: 1326666

Whenever I need to move a repo (with its full history), I recommend git bundle: it creates only one file, which is easier to move/send/copy around.

You can then clone your repo directly from the bundle file.

That being said, as described in "Restoring a Gitlab Bundle", the gitlab-rake gitlab:backup:create command does bundles for you (except they are tar files)
See more at "Backing up and restoring GitLab".

Upvotes: 1

Related Questions