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

Comments

Leave a Reply

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.

If you’d like to utilise the power of Webmentions do the following:
1: Create a post or something as a response to this one and make sure that the response contains this posts permalink URL (protip: copy and paste it from your browser)
3: Copy and paste the URL from your response in the field below and click Ping Me! 3: Wait for the moderation gnomes to do their work.
4: Done!