Gerrit Admin

From LSDevLinux
Jump to: navigation, search

Some random notes about administering Gerrit and using repo

Administrative tasks

Creating a new project

$ ssh -p 29418 mygerritusername@hydra.wycliffe.ca gerrit create-project --name new/project --description "'description for new project'"

Then import the existing code base into Gerrit's git repo:

$ git push ssh://mygerritusername@hydra.wycliffe.ca:29418/new/project HEAD:refs/heads/master

You might have to edit the access rights for the project in Gerrit and temporarily add Forge Identity:+3 for your user/group.

Using repo

Initializing complete FieldWorks project

$ mkdir fwrepo
$ cd fwrepo
$ repo init -u git://git.lsdev.sil.org/Calgary/WW/manifest.git
$ repo sync
$ cd Calgary/WW
$ git config --add remote.gerrit.fetch +refs/remotes/p4/*:refs/remotes/p4/*
$ git config review."hydra.wycliffe.ca:9160".username mygerritusername
$ git fetch gerrit
$ cd .git/hooks
$ ln -s ../../../../manifests/pre-rebase .

Starting work in a topic branch

$ repo start BRANCHNAME --all

Sending changes for review to Gerrit

$ repo upload