Setting up environment

This chapter is based on the Git Guide and the Gerrit Guide in the Linux Foundation Releng Documentation.

Prerequisites

Before you start, you should have an LFID account (sign up here).

Installing git

  1. Install Git.

    For Debian based systems:

    sudo apt-get install git -y
    

    For rpm based systems:

    sudo dnf install git -y
    

    For MacOS systems, install homebrew and install Git

    brew install git
    

Note

For more information on git, see the Git Guide in the Linux Foundation Releng Documentation.

Configure Git

  1. Set the author name or email used to sign off a commit with the following commands.

git config --local user.name "Your Name"
git config --local user.email yourname@example.com

Note

Your name and e-mail address (including capitalization) must match the one you entered when creating your LFID account.

  1. Optionally, change the Git commit editor to your preferred editor, for example, vim.

git config --global core.editor "vim"

Installing git-review

  1. Install git-review.

pip install git-review

Note

If you don’t have pip installed already, follow the installation documentation for pip.

Setting up gerrit

Setting SSH keys

  1. Generate SSH keys.

    For OpenSSH 8.7 or older versions:

    ssh-keygen -t rsa
    

    For OpenSSH 8.8 or later versions, either use ed25519 or ECDSA algorithm to generate ssh keys:

    ssh-keygen -t ed25519
    

    or

    ssh-keygen -t ECDSA
    

    Note

    OpenSSH 8.8+ disables RSA signatures using the SHA-1 hash algorithm by default, which may cause authentication problem when pull/push code. You can either specify the encrypt algorithm or re-enable the RSA/SHA1 in ~/.ssh/config file to solve the issue. For more information, please refer to OpenSSH Release Notes.

    Your public key is now available as .ssh/id_rsa.pub or .ssh/id_ed25519.pub or .ssh/id_ecdsa.pub under .ssh folder.

  2. Print the generated key to the terminal and copy it.

cat .ssh/id_rsa.pub
  1. On the project gerrit page, go to Settings.

Settings page for your Gerrit account
  1. Click SSH Public Keys under Settings.

  2. Click Add Key.

  3. In the Add SSH Public Key text box, paste the contents of your id_rsa.pub file and then click Add.

Adding your SSH key

Setting up CLA as an individual contributor

  1. Navigate to Settings — the gear icon on the upper right corner, and click Agreements from the menu on the left:

https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/settings-icon.png
https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/agreements.png
  1. Click New Contributor Agreement.

https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/agreement-link.png
  1. New Contributor Agreement types appear:

https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/new-contributor-agreement.png
  1. Choose the Individual CLA option.

../../../_images/CLA_types.png
  1. Click the Please review the agreement link and then click the message link that appears:

https://raw.githubusercontent.com/communitybridge/docs/master/.gitbook/assets/cla-gerrit-icla-proceed-to-sign-cla.png
  1. Sign in to EasyCLA if you are prompted.

  2. Select Company.

Note

To contribute to this project, you must be authorized under a signed Contributor License Agreement. You are contributing on behalf of your work for a company.

If any further prompts appear, follow the steps described at the below links:

  1. Complete the form and click SEND.

The CCLA manager signs a Corporate CLA and adds you to the approved list.