Moon Light Box

Time is Money

Gerrit - pre-receive hook declined

| Comments

Problem

When Gerrit sync data to Gitlab, the error message show in replication_log.

# tail -200 $GERRIT_HOME/log/replication_log

[2016-02-15 12:29:30,623] [19262100] Failed replicate of refs/heads/master to root@10.16.179.37:/var/opt/gitlab/git-data/repositories/root/test_only.git, reason: pre-receive hook declined

Solution

# vim $GERRIT_HOME/etc/replication.config

[remote "gitlab"]
    url = http://gerrit:XXXXX@10.10.10.10/gerrit/${name}.git  // You must create the "gerrit" account in Gitlab first.
    push = +refs/heads/*:refs/heads/*
    push = +refs/tags/*:refs/tags/*
    threads = 1

# $GERRIT_HOME/bin/gerrit.sh restart

Comments

comments powered by Disqus