- Set Up SSH Keys in Gerrit
- Generate New SSH Key
- Add Your SSH Key
- Add SSH Key to your Gerrit Account
- Add SSH Key to use with Git
- Download Extension Using Git
- How to Submit a Patch
- Gerrit - Update Master
- Gerrit - Create Branch
- Make & Commit Your Change
- Prepare Push change set to Gerrit
- Push your change set to Gerrit
- View the Change / Next Steps
- Editing via the Web-Interface
- How Code is reviewed in Gerrit
- Review Before Merge
- Gerrit - Project Owners
- How to Comment on, review, merge
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Gerrit - Make & Commit Your Change
When you modify the code in the local file system, you can check for the changes within the directory using the following command.
$ git diff
In the project directory, we will modify some changes in the file called Example/Example.hooks.php and run the above command. We will get the result as shown in the following screenshot.
You can check the changes made to the files or the directory using the following command.
$ git status
The above command allows to see which changes have been staged, which have not, and which files are not tracked by Git.
Next, you can add the changes in the working directory and update the file in the next commit using following command.
$ git add Example/Example.hooks.php
After adding the file, again run the git status command to review the changes added to the staging area as shown in the following screenshot.
You can see the difference between the index and your last commit, and what contents have been staged, using the following command.
$ git diff --cached
You can push the changes to the remote directory from the local repository using the following command.
$ git commit
When you run the above command, it will ask to add the commit message for your changes. This message will be seen by other people when you push the commit to the other repository.
Add the commit message and run the command again as git commit, which will display the commit message as shown in the following screenshot.