Hello everyone. In the previous episode, we learned how to use “commit” to submit the new code version to the local repository. However, by just submitting to the local repository, there is a risk of losing data or files if our local computer encounters problems. Therefore, once we are confident that the current version is safe and reliable, we will use the “PUSH” operation to push the current version to the remote repository. This will ensure that the current version exists in both the local and remote repositories, providing further protection. In this episode, we will learn how to use IntelliJ IDEA to perform the PUSH operation.
The IntelliJ IDEA version I am using for this operation is 2022.2.3 (Community Edition).
Things to note before performing the PUSH operation
Before performing the PUSH operation, please be aware that the version being pushed to the remote repository could potentially be used by other members of the development team. Therefore, before pushing, please ensure to check the following items to avoid unnecessary complications in the future
- Please ensure to first pull the latest version from the remote repository to your local repository and resolve any code conflicts before re-committing the corrected version to the local repository.
- Please make sure that this is a feature branch.
- Please make sure that this version has passed unit tests.
- Please ensure that this version is a complete functional release, and the developer has performed the first round of testing.
To push the committed version to the remote repository
After completing the commit submission and confirming the four precautions mentioned in the previous section, let’s proceed with the push action.
1.Click on the “green upward arrow” in the top right corner of the Git shortcut bar, or press “Ctrl+Shift+K” on the keyboard.

2.At this point, a Push panel will pop up. In the top left corner, you can see the push direction indication. In this example, it shows “main → origin/main”. The “main” on the left side of the arrow refers to the main branch in our local repository. The “origin” on the right side of the arrow refers to the remote repository, and “main” next to “origin” refers to the main branch in the remote repository. So, the interpretation of this indication is: push the current latest version of our local main branch to the main branch in the remote repository.
The interface in the bottom left corner displays all the commit versions from the last push to the current one. The bottom right corner displays the list of files that will be affected by this push.
After confirming everything is correct, we press the Push button in the bottom right corner to perform the push action.

3.After the push is completed, we can see a notification in the bottom right corner indicating that the push has been successfully executed.

4.Finally, let’s go to the GitHub website to confirm whether our push was successful.

As shown in the figure, the version we just pushed has been successfully pushed to the remote GitHub repository.




