Praca z Gerritem

Account setup

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

  2. Musisz również [wstąpić klucz SSH]https://review.jami.net/settings/#SSHKeys) aby móc dokonać zmian do przeglądu.

  3. Nie zapomnij wybrać nazwy użytkownika.

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

Ważne

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

To view your Git config

git konfiguracja --list

To test your SSH access

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

ssh -p 29420 <nazwa użytkownika>@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.

Aby zaktualizować konfigurację

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

git odległe ustawienie url pochodzenia ssh://<username>@review.jami.net:29420/<project_name>

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

Albo sklonuj istniejący repozytorium, jeśli chcesz zacząć od nowa.

W przypadku refs/for/master należy podać pod warunkiem domyślnego.

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

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

Aby stworzyć przegląd

Gdy przyjdziecie do tej magicznej gałęzi, automatycznie zostanie stworzona recenzja Gerrita.

git powstał z napędu Głowa:refs/for/master

Jeśli ustawiłeś domyślny ustawień do refs/for/master jak opisano powyżej, po prostu

git wcisnąć

Jeśli HEAD wskazuje obecnie na oddział z commits chcesz przesunąć. idealnie powinieneś pracować w oddziale funkcji / błędów dla problemu w ręce.

`git

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.

Na przykład możesz chcieć, aby odległość „prywatna” została prześwietlona; otwórz <project_dir>/.git/config i dodaj:

[remote "private"]

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

A potem:

git popychać prywatny

Praca prywatna jest taka sama jak zestawy patchów, z wyjątkiem tego, że nie są one domyślnie widoczne dla innych i nie wywołują żadnych budowli Jenkins.