Document Purpose: Walkthrough configuring your workstation and a Gerrit account. This is needed to participate in OpenBMC's Gerrit-based code reviews.
Prerequisites: Current Linux, Mac, or Windows system. Git packages installed. E-mail account (recommended to use the same e-mail address for both Gerrit and GitHub).
git config --global --add user.name "Your name" (eg. John Smith)
git config --global --add user.email "youremail@your-domain" (eg. jsmith@somedomain.com)
git config --global --add diff.tool "preferred diff tool" (eg. gvimdiff or meld)
Create keys: ssh-keygen -t rsa -C "your_email@your-domain"
Add Keys to Github:
Add Keys to OpenBMC's Gerrit Server:
Add the following to ~/.ssh/config
:
Host openbmc.gerrit Hostname gerrit.openbmc-project.xyz Port 29418 User <YOUR-GERRIT-ID>
AFSTokenPassing no
to be added to the SSH entry if using AFS.chmod 600 ~/.ssh/*
Test connectivity to Gerrit by attempting to clone a repo
git clone ssh://openbmc.gerrit/openbmc/docs
Checking out files: 100% (45/45), done.
Inside the repo you just cloned, enter the following commands:
gitdir=$(git rev-parse --git-dir) scp -p -P 29418 openbmc.gerrit:hooks/commit-msg ${gitdir}/hooks
This will enhance the git commit
command to add a Change-Id
to your commit message which Gerrit uses to track the review.
If you've completed all of the above steps successfully, that's it! You are now set up to push your changes up to Gerrit for code review!