SlideShare a Scribd company logo
1 of 13
Download to read offline
Gerrit
i
AbouttheTutorial
Gerrit is a web-based code review tool, which is integrated with Git and built on top of Git
version control system (helps developers to work together and maintain the history of
their work). It allows merging changes to Git repository when you are done with the code
reviews.
Audience
This tutorial will help beginners learn the basic functionality of Gerrit tool. After completing
this tutorial, you will find yourself at a moderate level of expertise in using Gerrit tool from
where you can take yourself to the next levels.
Prerequisites
We assume that you are going to use Gerrit to handle all levels of Java and Non-Java
projects. Hence, it will be good if you have some amount of exposure to software
development life cycle and a working knowledge of developing web-based and non-web-
based applications.
Copyright&Disclaimer
 Copyright 2018 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of Tutorials Point (I)
Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish
any contents or a part of contents of this e-book in any manner without written consent
of the publisher.
We strive to update the contents of our website and tutorials as timely and as precisely as
possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.
Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our
website or its contents including this tutorial. If you discover any errors on our website or
in this tutorial, please notify us at contact@tutorialspoint.com
Gerrit
ii
TableofContents
About the Tutorial ............................................................................................................................................i
Audience...........................................................................................................................................................i
Prerequisites.....................................................................................................................................................i
Copyright & Disclaimer.....................................................................................................................................i
Table of Contents ............................................................................................................................................ ii
1. Gerrit ─ Overview......................................................................................................................................1
SETTING UP GERRIT ....................................................................................................................4
2. Gerrit ─ Installation...................................................................................................................................5
Installation of Git Client...................................................................................................................................5
3. Gerrit ─ Configure Git................................................................................................................................6
4. Gerrit ─ Set Username & Email..................................................................................................................7
SET UP SSH KEYS IN GERRIT.........................................................................................................8
5. Gerrit ─ Generate New SSH Key ................................................................................................................9
6. Gerrit ─ Add Your SSH Key.......................................................................................................................10
7. Gerrit ─ Add SSH Key to Your Gerrit Account ..........................................................................................12
8. Gerrit ─ Add SSH Key to Use with Git ......................................................................................................15
9. Gerrit ─ Download Examples Using Git....................................................................................................16
PREPARE TO WORK WITH GERRIT.............................................................................................17
10. Gerrit ─ Installing Git-Review ..................................................................................................................18
11. Gerrit ─ Configuring Git-Review ..............................................................................................................21
12. Gerrit ─ Setting Up Git-Review................................................................................................................22
HOW TO SUBMIT A PATCH........................................................................................................23
13. Gerrit ─ Update Master...........................................................................................................................24
14. Gerrit ─ Create a Branch..........................................................................................................................25
15. Gerrit ─ Make & Commit Your Change ....................................................................................................26
16. Gerrit ─ Prepare Push Change Set to Gerrit.............................................................................................29
17. Gerrit ─ Push Your Change Set to Gerrit..................................................................................................30
Gerrit
iii
18. Gerrit ─ View the Change / Next Steps....................................................................................................31
19. Gerrit ─ Editing via the Web-Interface.....................................................................................................33
HOW CODE IS REVIEWED IN GERRIT .........................................................................................40
20. Gerrit ─ Review before Merge.................................................................................................................41
21. Gerrit ─ Project Owners ..........................................................................................................................42
22. Gerrit ─ How to Comment, Review, and Merge............................................. Error! Bookmark not defined.
Gerrit
1
Gerrit is a web-based code review tool, which is integrated with Git and built on top of Git
version control system (helps developers to work together and maintain the history of
their work). It allows to merge changes to Git repository, when you are done with the code
reviews.
Gerrit was developed by Shawn Pearce at Google which is written in Java, Servlet, GWT
(Google Web Toolkit). The stable release of Gerrit is 2.12.2 and published on March 11,
2016 licensed under Apache License v2.
Why Use Gerrit?
Following are certain reasons, why you should use Gerrit.
 You can easily find the error in the source code using Gerrit.
 You can work with Gerrit, if you have regular Git client; no need to install any Gerrit
client.
 Gerrit can be used as an intermediate between developers and git repositories.
Features of Gerrit
 Gerrit is a free and an open source Git version control system.
 The user interface of Gerrit is formed on Google Web Toolkit.
 It is a lightweight framework for reviewing every commit.
 Gerrit acts as a repository, which allows pushing the code and creates the review
for your commit.
Advantages of Gerrit
 Gerrit provides access control for Git repositories and web frontend for code review.
 You can push the code without using additional command line tools.
 Gerrit can allow or decline the permission on the repository level and down to the
branch level.
 Gerrit is supported by Eclipse.
1. Gerrit ─ Overview
Gerrit
2
Disadvantages of Gerrit
 Reviewing, verifying, and resubmitting the code commits, slows down the time to
market.
 Gerrit can work only with Git.
 Gerrit is slow and it's not possible to change the sort order in which changes are
listed.
 You need administrator rights to add repository on Gerrit.
Gerrit
3
Setting Up Gerrit
Gerrit
4
Before you can use Gerrit, you have to install Git and perform some basic configuration
changes. Following are the steps to install Git client on different platforms.
InstallationofGitClient
Linux
You can install the Git on Linux by using the software package management tool. For
instance, if you are using Fedora, you can use as:
sudo yum install git
If you are using Debian-based distribution such as Ubuntu, then use the following
command:
sudo apt-get install git
Windows
You can install Git on Windows by downloading it from the Git website. Just go
to msysgit.github.io link and click on the download button.
Mac
Git can be installed on Mac using the following command:
brew install git
Another way of installing Git is, by downloading it from Git website. Just go to Git install
on Mac link, which will install Git for Mac platform.
2. Gerrit ─ Installation
Gerrit
5
Once you have installed Git, you need to customize the configuration variables to add your
personal information. You can get and set the configuration variables by using Git tool
called git config along with the -l option (this option provides the current configuration).
git config -l
When you run the above command, you will get the configuration variables as shown in
the following image.
You can change the customized information any time by using the commands again. In
the next chapter, you will learn how to configure the user name and user Email by using
git config command.
3. Gerrit ─ Configure Git
Gerrit
6
You can track each commit by setting name and email variables. The name variable
specifies the name, while the email variable identifies the email address associated with
Git commits. You can set these using the following commands:
git config --global user.email "your_email@mail.com"
git config --global user.name "your_name"
When you run the above commands, you will get the user name and email address as
shown in the following image.
4. Gerrit ─ Set Username & Email
Gerrit
7
Set Up SSH Keys in Gerrit
Gerrit
8
SSH stands for Secure Shell or sometimes Secure Socket Shell protocol used for accessing
network services securely from a remote computer. You can set the SSH keys to provide
a reliable connection between the computer and Gerrit.
You can check the existing SSH key on your local computer using the following command
in Git Bash:
$ ls ~/.ssh
After clicking the enter button, you will see the existing SSH key as shown in the following
image:
If you don't find any existing SSH key, then you need to create a new SSH key.
Generating New SSH Key
You can generate a new SSH key for authentication using the following command in Git
Bash:
$ ssh-keygen -t rsa -C "your_email@mail.com"
If you already have a SSH key, then don't a generate new key, as they will be overwritten.
You can use ssh-keygen command, only if you have installed Git with Git Bash.
When you run the above command, it will create 2 files in the ~/.ssh directory.
 ~/.ssh/id_rsa: It is private key or identification key.
 ~/.ssh/id_rsa.pub: It is a public tv.
5. Gerrit ─ Generate New SSH Key
Gerrit
9
End of ebook preview
If you liked what you saw…
Buy it from our store @ https://store.tutorialspoint.com

More Related Content

What's hot

Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginnersbryanbibat
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflowsArthur Shvetsov
 
Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservicesLuram Archanjo
 
Gerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHubGerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHubLuca Milanesio
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperJohn Stevenson
 
HiveMQ Webinar: Lightweight and scalable IoT Messaging with MQTT
HiveMQ Webinar: Lightweight and scalable IoT Messaging with MQTTHiveMQ Webinar: Lightweight and scalable IoT Messaging with MQTT
HiveMQ Webinar: Lightweight and scalable IoT Messaging with MQTTDominik Obermaier
 
Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github SahilSonar4
 

What's hot (20)

Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git e GitHub
Git e GitHubGit e GitHub
Git e GitHub
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
Micronaut: A new way to build microservices
Micronaut: A new way to build microservicesMicronaut: A new way to build microservices
Micronaut: A new way to build microservices
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
BitBucket presentation
BitBucket presentationBitBucket presentation
BitBucket presentation
 
Github
GithubGithub
Github
 
Gerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHubGerrit multi-master / multi-site at GerritHub
Gerrit multi-master / multi-site at GerritHub
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 
HiveMQ Webinar: Lightweight and scalable IoT Messaging with MQTT
HiveMQ Webinar: Lightweight and scalable IoT Messaging with MQTTHiveMQ Webinar: Lightweight and scalable IoT Messaging with MQTT
HiveMQ Webinar: Lightweight and scalable IoT Messaging with MQTT
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git Rebase vs Merge
Git Rebase vs MergeGit Rebase vs Merge
Git Rebase vs Merge
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Beginner's guide to git and github
Beginner's guide to git and github Beginner's guide to git and github
Beginner's guide to git and github
 

Similar to Gerrit tutorial

Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Joel W. King
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and GithubWycliff1
 
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfuzair
 
Github security bug bounty hunting
Github security   bug bounty huntingGithub security   bug bounty hunting
Github security bug bounty huntingvinoth kumar
 
Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Luca Milanesio
 
GitPro Whitepaper
GitPro WhitepaperGitPro Whitepaper
GitPro WhitepaperERP Buddies
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfmurad khan
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersMartin Jinoch
 
Learning Git and GitHub - BIT GDSC.pdf
Learning Git and GitHub - BIT GDSC.pdfLearning Git and GitHub - BIT GDSC.pdf
Learning Git and GitHub - BIT GDSC.pdfJayprakash677449
 
A crash course on git as version control system and GitHub
A crash course on git as version control system and GitHubA crash course on git as version control system and GitHub
A crash course on git as version control system and GitHubJerome Mberia
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxAbelPhilipJoseph
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticlePRIYATHAMDARISI
 
GIT training - advanced for software projects
GIT training - advanced for software projectsGIT training - advanced for software projects
GIT training - advanced for software projectsThierry Gayet
 
My Notes from https://www.codeschool.com/courses/git-real
My Notes from  https://www.codeschool.com/courses/git-realMy Notes from  https://www.codeschool.com/courses/git-real
My Notes from https://www.codeschool.com/courses/git-realEneldo Serrata
 

Similar to Gerrit tutorial (20)

Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git step by step
Git step by stepGit step by step
Git step by step
 
Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)Introduction to Git for Network Engineers (Lab Guide)
Introduction to Git for Network Engineers (Lab Guide)
 
Introduction to git and Github
Introduction to git and GithubIntroduction to git and Github
Introduction to git and Github
 
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdfGit Tutorial A Comprehensive Guide for Beginners.pdf
Git Tutorial A Comprehensive Guide for Beginners.pdf
 
Github security bug bounty hunting
Github security   bug bounty huntingGithub security   bug bounty hunting
Github security bug bounty hunting
 
Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3Gerrit Code Review v3.2 and v3.3
Gerrit Code Review v3.2 and v3.3
 
GitPro Whitepaper
GitPro WhitepaperGitPro Whitepaper
GitPro Whitepaper
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdf
 
BLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes DevelopersBLUG 2012 Version Control for Notes Developers
BLUG 2012 Version Control for Notes Developers
 
Learning Git and GitHub - BIT GDSC.pdf
Learning Git and GitHub - BIT GDSC.pdfLearning Git and GitHub - BIT GDSC.pdf
Learning Git and GitHub - BIT GDSC.pdf
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
A crash course on git as version control system and GitHub
A crash course on git as version control system and GitHubA crash course on git as version control system and GitHub
A crash course on git as version control system and GitHub
 
git github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptxgit github PPT_GDSCIIITK.pptx
git github PPT_GDSCIIITK.pptx
 
Introduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech ArticleIntroduction to GitHub, Open Source and Tech Article
Introduction to GitHub, Open Source and Tech Article
 
GIT training - advanced for software projects
GIT training - advanced for software projectsGIT training - advanced for software projects
GIT training - advanced for software projects
 
Git and git hub basics
Git and git hub basicsGit and git hub basics
Git and git hub basics
 
My Notes from https://www.codeschool.com/courses/git-real
My Notes from  https://www.codeschool.com/courses/git-realMy Notes from  https://www.codeschool.com/courses/git-real
My Notes from https://www.codeschool.com/courses/git-real
 
Git Training
Git TrainingGit Training
Git Training
 

More from HarikaReddy115

Data structures algorithms_tutorial
Data structures algorithms_tutorialData structures algorithms_tutorial
Data structures algorithms_tutorialHarikaReddy115
 
Wireless communication tutorial
Wireless communication tutorialWireless communication tutorial
Wireless communication tutorialHarikaReddy115
 
Control systems tutorial
Control systems tutorialControl systems tutorial
Control systems tutorialHarikaReddy115
 
Computer logical organization_tutorial
Computer logical organization_tutorialComputer logical organization_tutorial
Computer logical organization_tutorialHarikaReddy115
 
Computer fundamentals tutorial
Computer fundamentals tutorialComputer fundamentals tutorial
Computer fundamentals tutorialHarikaReddy115
 
Compiler design tutorial
Compiler design tutorialCompiler design tutorial
Compiler design tutorialHarikaReddy115
 
Communication technologies tutorial
Communication technologies tutorialCommunication technologies tutorial
Communication technologies tutorialHarikaReddy115
 
Behavior driven development_tutorial
Behavior driven development_tutorialBehavior driven development_tutorial
Behavior driven development_tutorialHarikaReddy115
 
Basics of computers_tutorial
Basics of computers_tutorialBasics of computers_tutorial
Basics of computers_tutorialHarikaReddy115
 
Basics of computer_science_tutorial
Basics of computer_science_tutorialBasics of computer_science_tutorial
Basics of computer_science_tutorialHarikaReddy115
 
Basic electronics tutorial
Basic electronics tutorialBasic electronics tutorial
Basic electronics tutorialHarikaReddy115
 
Artificial neural network_tutorial
Artificial neural network_tutorialArtificial neural network_tutorial
Artificial neural network_tutorialHarikaReddy115
 
Artificial intelligence tutorial
Artificial intelligence tutorialArtificial intelligence tutorial
Artificial intelligence tutorialHarikaReddy115
 
Antenna theory tutorial
Antenna theory tutorialAntenna theory tutorial
Antenna theory tutorialHarikaReddy115
 
Analog communication tutorial
Analog communication tutorialAnalog communication tutorial
Analog communication tutorialHarikaReddy115
 

More from HarikaReddy115 (20)

Dbms tutorial
Dbms tutorialDbms tutorial
Dbms tutorial
 
Data structures algorithms_tutorial
Data structures algorithms_tutorialData structures algorithms_tutorial
Data structures algorithms_tutorial
 
Wireless communication tutorial
Wireless communication tutorialWireless communication tutorial
Wireless communication tutorial
 
Cryptography tutorial
Cryptography tutorialCryptography tutorial
Cryptography tutorial
 
Cosmology tutorial
Cosmology tutorialCosmology tutorial
Cosmology tutorial
 
Control systems tutorial
Control systems tutorialControl systems tutorial
Control systems tutorial
 
Computer logical organization_tutorial
Computer logical organization_tutorialComputer logical organization_tutorial
Computer logical organization_tutorial
 
Computer fundamentals tutorial
Computer fundamentals tutorialComputer fundamentals tutorial
Computer fundamentals tutorial
 
Compiler design tutorial
Compiler design tutorialCompiler design tutorial
Compiler design tutorial
 
Communication technologies tutorial
Communication technologies tutorialCommunication technologies tutorial
Communication technologies tutorial
 
Biometrics tutorial
Biometrics tutorialBiometrics tutorial
Biometrics tutorial
 
Behavior driven development_tutorial
Behavior driven development_tutorialBehavior driven development_tutorial
Behavior driven development_tutorial
 
Basics of computers_tutorial
Basics of computers_tutorialBasics of computers_tutorial
Basics of computers_tutorial
 
Basics of computer_science_tutorial
Basics of computer_science_tutorialBasics of computer_science_tutorial
Basics of computer_science_tutorial
 
Basic electronics tutorial
Basic electronics tutorialBasic electronics tutorial
Basic electronics tutorial
 
Auditing tutorial
Auditing tutorialAuditing tutorial
Auditing tutorial
 
Artificial neural network_tutorial
Artificial neural network_tutorialArtificial neural network_tutorial
Artificial neural network_tutorial
 
Artificial intelligence tutorial
Artificial intelligence tutorialArtificial intelligence tutorial
Artificial intelligence tutorial
 
Antenna theory tutorial
Antenna theory tutorialAntenna theory tutorial
Antenna theory tutorial
 
Analog communication tutorial
Analog communication tutorialAnalog communication tutorial
Analog communication tutorial
 

Recently uploaded

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 

Recently uploaded (20)

_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 

Gerrit tutorial

  • 1.
  • 2. Gerrit i AbouttheTutorial Gerrit is a web-based code review tool, which is integrated with Git and built on top of Git version control system (helps developers to work together and maintain the history of their work). It allows merging changes to Git repository when you are done with the code reviews. Audience This tutorial will help beginners learn the basic functionality of Gerrit tool. After completing this tutorial, you will find yourself at a moderate level of expertise in using Gerrit tool from where you can take yourself to the next levels. Prerequisites We assume that you are going to use Gerrit to handle all levels of Java and Non-Java projects. Hence, it will be good if you have some amount of exposure to software development life cycle and a working knowledge of developing web-based and non-web- based applications. Copyright&Disclaimer  Copyright 2018 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at contact@tutorialspoint.com
  • 3. Gerrit ii TableofContents About the Tutorial ............................................................................................................................................i Audience...........................................................................................................................................................i Prerequisites.....................................................................................................................................................i Copyright & Disclaimer.....................................................................................................................................i Table of Contents ............................................................................................................................................ ii 1. Gerrit ─ Overview......................................................................................................................................1 SETTING UP GERRIT ....................................................................................................................4 2. Gerrit ─ Installation...................................................................................................................................5 Installation of Git Client...................................................................................................................................5 3. Gerrit ─ Configure Git................................................................................................................................6 4. Gerrit ─ Set Username & Email..................................................................................................................7 SET UP SSH KEYS IN GERRIT.........................................................................................................8 5. Gerrit ─ Generate New SSH Key ................................................................................................................9 6. Gerrit ─ Add Your SSH Key.......................................................................................................................10 7. Gerrit ─ Add SSH Key to Your Gerrit Account ..........................................................................................12 8. Gerrit ─ Add SSH Key to Use with Git ......................................................................................................15 9. Gerrit ─ Download Examples Using Git....................................................................................................16 PREPARE TO WORK WITH GERRIT.............................................................................................17 10. Gerrit ─ Installing Git-Review ..................................................................................................................18 11. Gerrit ─ Configuring Git-Review ..............................................................................................................21 12. Gerrit ─ Setting Up Git-Review................................................................................................................22 HOW TO SUBMIT A PATCH........................................................................................................23 13. Gerrit ─ Update Master...........................................................................................................................24 14. Gerrit ─ Create a Branch..........................................................................................................................25 15. Gerrit ─ Make & Commit Your Change ....................................................................................................26 16. Gerrit ─ Prepare Push Change Set to Gerrit.............................................................................................29 17. Gerrit ─ Push Your Change Set to Gerrit..................................................................................................30
  • 4. Gerrit iii 18. Gerrit ─ View the Change / Next Steps....................................................................................................31 19. Gerrit ─ Editing via the Web-Interface.....................................................................................................33 HOW CODE IS REVIEWED IN GERRIT .........................................................................................40 20. Gerrit ─ Review before Merge.................................................................................................................41 21. Gerrit ─ Project Owners ..........................................................................................................................42 22. Gerrit ─ How to Comment, Review, and Merge............................................. Error! Bookmark not defined.
  • 5. Gerrit 1 Gerrit is a web-based code review tool, which is integrated with Git and built on top of Git version control system (helps developers to work together and maintain the history of their work). It allows to merge changes to Git repository, when you are done with the code reviews. Gerrit was developed by Shawn Pearce at Google which is written in Java, Servlet, GWT (Google Web Toolkit). The stable release of Gerrit is 2.12.2 and published on March 11, 2016 licensed under Apache License v2. Why Use Gerrit? Following are certain reasons, why you should use Gerrit.  You can easily find the error in the source code using Gerrit.  You can work with Gerrit, if you have regular Git client; no need to install any Gerrit client.  Gerrit can be used as an intermediate between developers and git repositories. Features of Gerrit  Gerrit is a free and an open source Git version control system.  The user interface of Gerrit is formed on Google Web Toolkit.  It is a lightweight framework for reviewing every commit.  Gerrit acts as a repository, which allows pushing the code and creates the review for your commit. Advantages of Gerrit  Gerrit provides access control for Git repositories and web frontend for code review.  You can push the code without using additional command line tools.  Gerrit can allow or decline the permission on the repository level and down to the branch level.  Gerrit is supported by Eclipse. 1. Gerrit ─ Overview
  • 6. Gerrit 2 Disadvantages of Gerrit  Reviewing, verifying, and resubmitting the code commits, slows down the time to market.  Gerrit can work only with Git.  Gerrit is slow and it's not possible to change the sort order in which changes are listed.  You need administrator rights to add repository on Gerrit.
  • 8. Gerrit 4 Before you can use Gerrit, you have to install Git and perform some basic configuration changes. Following are the steps to install Git client on different platforms. InstallationofGitClient Linux You can install the Git on Linux by using the software package management tool. For instance, if you are using Fedora, you can use as: sudo yum install git If you are using Debian-based distribution such as Ubuntu, then use the following command: sudo apt-get install git Windows You can install Git on Windows by downloading it from the Git website. Just go to msysgit.github.io link and click on the download button. Mac Git can be installed on Mac using the following command: brew install git Another way of installing Git is, by downloading it from Git website. Just go to Git install on Mac link, which will install Git for Mac platform. 2. Gerrit ─ Installation
  • 9. Gerrit 5 Once you have installed Git, you need to customize the configuration variables to add your personal information. You can get and set the configuration variables by using Git tool called git config along with the -l option (this option provides the current configuration). git config -l When you run the above command, you will get the configuration variables as shown in the following image. You can change the customized information any time by using the commands again. In the next chapter, you will learn how to configure the user name and user Email by using git config command. 3. Gerrit ─ Configure Git
  • 10. Gerrit 6 You can track each commit by setting name and email variables. The name variable specifies the name, while the email variable identifies the email address associated with Git commits. You can set these using the following commands: git config --global user.email "your_email@mail.com" git config --global user.name "your_name" When you run the above commands, you will get the user name and email address as shown in the following image. 4. Gerrit ─ Set Username & Email
  • 11. Gerrit 7 Set Up SSH Keys in Gerrit
  • 12. Gerrit 8 SSH stands for Secure Shell or sometimes Secure Socket Shell protocol used for accessing network services securely from a remote computer. You can set the SSH keys to provide a reliable connection between the computer and Gerrit. You can check the existing SSH key on your local computer using the following command in Git Bash: $ ls ~/.ssh After clicking the enter button, you will see the existing SSH key as shown in the following image: If you don't find any existing SSH key, then you need to create a new SSH key. Generating New SSH Key You can generate a new SSH key for authentication using the following command in Git Bash: $ ssh-keygen -t rsa -C "your_email@mail.com" If you already have a SSH key, then don't a generate new key, as they will be overwritten. You can use ssh-keygen command, only if you have installed Git with Git Bash. When you run the above command, it will create 2 files in the ~/.ssh directory.  ~/.ssh/id_rsa: It is private key or identification key.  ~/.ssh/id_rsa.pub: It is a public tv. 5. Gerrit ─ Generate New SSH Key
  • 13. Gerrit 9 End of ebook preview If you liked what you saw… Buy it from our store @ https://store.tutorialspoint.com