Bekerja dengan Gerrit

Account setup

  1. Sign in with your Google, GitHub, or git.jami.net account.

  2. Anda juga perlu [upload key SSH]https://review.jami.net/settings/#SSHKeys) untuk dapat melakukan perubahan untuk review.

  3. Jangan lupa untuk memilih nama pengguna.

  4. Finally, the email address specified in your git config must match one of the email addresses registered with your Gerrit account.

Penting

For Savoir-faire Linux Inc. employees: please continue to use your @savoirfairelinux.com email address.

To view your Git config

git konfigurasi --list

To test your SSH access

To check that your SSH access is properly set up, run the following command:

ssh -p 29420 <username>@review.jami.net

is your Gerrit username that you should have set during the account creation. If not, you can do that here.

If your access is granted, you should see a message like:

****    Welcome to Gerrit Code Review    ****

Hi, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://<username>@review.jami.net:29420/REPOSITORY_NAME.git

Connection to review.jami.net closed.

Git configuration

Gerrit is the official Git repository.

Untuk memperbarui konfigurasi

You must update your remote information to now use the Gerrit repository. To do that, update your origin URL:

git remote set-url origin ssh://<username>@review.jami.net:29420/<project_name>

Replace <project_name> with the correct project (example: jami-daemon).

Atau mengkloning repositori yang ada jika Anda ingin memulai dari awal.

Untuk Dorong dengan Default di ref/for/master

You can configure Git to automatically create a review when a change is pushed.

git config remote.origin.push HEAD:refs/for/master

Untuk Membuat Tinjauan

Saat mendorong ke cabang sihir ini, review akan dibuat secara otomatis pada Gerrit.

git push origin HEAD:refs/for/master

Jika Anda mengkonfigurasi default ke refs/for/master seperti yang dijelaskan di atas, hanya

git mendorong

Jika HEAD saat ini menunjuk ke cabang dengan commit yang ingin Anda dorong. Idealnya, Anda harus bekerja di cabang fitur / bug untuk masalah yang sedang terjadi. Kemudian Anda dapat melakukan:

git push origin <bugfix_branchname>:refs/for/master

If this is the first time you've pushed, you will be prompted to install a post-commit hook to insert a Change-ID in your commit message. Gerrit needs this to track patch sets and will reject pushes until you install it. Simply copy and paste the command to install the hook as instructed by Gerrit and amend your commits.

To push a private patch

You can push a work in progress (a.k.a. draft) by pushing to refs/for/master%private.

Misalnya, Anda mungkin ingin remote "private" untuk menekan ke; buka <project_dir>/.git/config dan tambahkan:

[remote "private"]

    url = ssh://<username>@review.jami.net:29420/jami-daemon
    push = HEAD:refs/for/master%private

Lalu:

git mendorong pribadi

Karya pribadi sama seperti patchset, kecuali mereka tidak terlihat oleh orang lain secara default dan tidak memicu pembentukan Jenkins.