Thursday, August 23, 2018

How to push a repository from gitlab to Gerrit


Use following steps for move git repository from gitlab to Gerrit:
1) Login with admin role and create the repository in Gerrit using the UI
2) Clone the Gitlab repository using the "--bare" option
git clone -- bare git@repo-url(gitlab repo url)

3) Add the gerrit remote
    cd repo-name.git.
    git remote add gerrit gerrit-repo url.

4) Push all commit, branchs and tags to Gerrit
    get push -all gerrit(use --force if there is any issue related to push)
    get push --all gerrit

5) Remove bare repo directory:
    cd ..
    rm -rf repo-name.git.

No comments:

Post a Comment