Normal git command line can be used for committing and pushing changes to gerrit.
Cloning Git Repostirories
- The git clone command can be found on each project's gerrit page. For example, the project page for appc is located here: https://gerrit.onap.org/r/#/admin/projects/appc
- The "Clone with commit-msg hook" option should be selected and then either the "http" or "ssh" option should be selected.
- The "git clone...." command, located just below these options, can then be copied into your command line
- Use git add <file name> to stage changed files for commit
Commit the changes using: git commit -m "<name of the commit / first line of commit message>"
- git commit -s --amend will sign off the commit with your username and then will open up the commit message editor
- You will see a paragraph that contains the "Change-Id" and "Signed-off-by". Add a new line to this paragraph with the following:
- Issue-ID: <Jira issue id>
- The capitalization of the "Issue-ID" text must be exact
- The Jira issue id should match a valid Jira issue. For example "APPC-123" or "OOM-123" are valid issue ids.
- While the commit message editor is open, you can also add additional text to your commit message if you want
- To push the commit to gerrit, use the git push origin HEAD:refs/for/master command
- Normally you should be pushing to master, but if you need to push to a branch other than master, the "master" word can be replaced.
- For example, if you're pushing to Dublin branch: git push origin HEAD:refs/for/dublin