To add git repository, we can do one of these options,
Create a new git repository
Login into server as gerrit $cd review_site/bin $git init --bare foo.git Push changes into master in client $git clone ssh://<user name>@gerrit.yuneec.com:29418/foo $<commit CL into foo git> $git push origin HEAD:refs/for/master Merge CL in gerrit
Mirror from other git sources
$cd review_site/bin $git clone --mirror [email protected]:foo.git ⚠️ You have to put ssh key into ~/.ssh of gerrit user, and register SSH public key into git server.
After any of above option, restart gerrit service
$cd review_site/bin
$./gerrit.sh restart
If you mirror code from other sources, you can run this to update the git data from upstream git server.
$git remote update
⚠️ Update from upstream git server will overwrite all changes in the same branch. For example, if you change master branch in gerrit, and update it from external source. You change in master will lose. So you need stop mirror from git server if you starts check in code into gerrit, or use a different branch name as upstream.