Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Clone the repository:
    1. SSH:

      Code Block
      $ git clone ssh://{user}@gerrit.asterisk.org:29418/{repo}
    2. HTTP:

      Code Block
      $ git clone http://{user}@gerrit.asterisk.org/{repo}
    3. Anonymous HTTP:

      Code Block
      $ git clone http://gerrit.asterisk.org/{repo}
  2. Copy the commit-msg hook into your local .git/hooks folder:

    1. If you have git-review installed:

      Code Block
      $ git review -s
    2. Otherwise:

      Code Block
      $ scp -p -P 29418 {user}@gerrit.asterisk.org:hooks/commit-msg {local-repo}/.git/hooks/

      The commit-msg hook adds the Change-Id automatically to git commit messages. A Change-Id is necessary for Gerrit to associate multiple patch sets together. For more information, see Change-Ids.

Creating an SSH Alias

Since access to gerrit.asterisk.org is likely to occur often, you may want to set up an SSH alias:

...

Pushing to Gerrit for Code Review

Anchor
git-review
git-review
Use git review

  1. Install git-review:

    Code Block
    $ pip install git-review
  2. To submit a change to master:

    Code Block
    $ git review
  3. To submit a change for a particular branch:

    Code Block
    $ git review {branchname}
  4. To submit a change, including the ASTERISK issue:

    Code Block
    $ git review -t ASTERISK-12345

...