Setting up Git
Set Up SSH Keys in Gerrit
- Download Extension Using Git
- Add SSH Key to use with Git
- Add SSH Key to your Gerrit Account
- Add Your SSH Key
- Generate New SSH Key
Prepare to work with Gerrit
How to Submit a Patch
- Editing via the Web-Interface
- View the Change / Next Steps
- Push your change set to Gerrit
- Prepare Push change set to Gerrit
- Make & Commit Your Change
- Gerrit - Create Branch
- Gerrit - Update Master
How Code is reviewed in Gerrit
Gerrit Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
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.
Advertisements