...
- Clone the repository:
SSH:
Code Block $ git clone ssh://{user}@gerrit.asterisk.org:29418/{repo}
HTTP:
Code Block $ git clone http://{user}@gerrit.asterisk.org/{repo}
Anonymous HTTP:
Code Block $ git clone http://gerrit.asterisk.org/{repo}
Copy the
commit-msg
hook into your local.git/hooks
folder:If you have
git-review
installed:Code Block $ git review -s
Otherwise:
Code Block $ scp -p -P 29418 {user}@gerrit.asterisk.org:hooks/commit-msg {local-repo}/.git/hooks/
The
commit-msg
hook adds theChange-Id
automatically to git commit messages. AChange-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
Install
git-review
:Code Block $ pip install git-review
To submit a change to
master
:Code Block $ git review
To submit a change for a particular branch:
Code Block $ git review {branchname}
To submit a change, including the
ASTERISK
issue:Code Block $ git review -t ASTERISK-12345
...