Gerrit commands and other bits

Gerrit is a really interesting code review tool. When I worked for one of my former employers I got to test it out and I was both intrigued and daunted by it.

The learning curve is sky-high with this one, but there’s a lot of things done right, when it comes to running huge code bases.

So, naturally, I want to use this at home as well, for my own pet projects. If nothing else, to keep myself updated on the technology.

Here are a few things that become important when you have got your Gerrit-site up and running. You know, the day-to-day and next-project kinda things that aren’t super obvious.

Cloning a repo

git clone ssh://[username]@[server]:29418/[project]

Getting the commit-hook

 scp -p -P 29418 [username]@[server]:hooks/commit-msg .git/hooks

Pushing to origin

git push origin HEAD:refs/for/master

Alternative way of pushing to origin

vim .git/config

[remote "gerrit"]
 url = http://[server]:29418/[git-repo]
 fetch = +refs/heads/master:refs/remotes/origin/master
 push = refs/heads/master:refs/for/master

git push gerrit

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.