[HOW TO] Committing Code Using Intellij IDEA


This is a blogging version of the guildeline on committing code to GitHub repository. The GitHub version is available here. You are welcomed to clone/fork and use them as your team's guildeline.

Committing Code using Intellij IDEA

This demonstration uses the Intellij IDEA Ultimate, version 2020.1. If you have already clone code, your IDE interface should look similar to this. Other Jetbrain IDEs, such as PyCharm, WebStorm, have very similar interface, so that you can use this tutorial if you are using other JetBrain IDEs.

1. Create a new branch

  1. Click the current branch (in this case, it is master)
  1. On the popped window, click the + New Branch
  1. Enter the name of your new branch.
  1. You can see now you are in dev branch.

2. Edit in the new branch

Edit code in the new branch.

3. Git Commit

Remember you are in the new branch while committing the code.

  1. Start committing code by clicking the commit button in the Git toolbox.
  1. Edit the commit message and add changed files on the popped window.
  1. You can directly commit the code to the local repository and push to GitHub by clicking the button on the right side of Commit.

  2. Now it is time to push the code onto Github.