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
- Click the current branch (in this case, it is
master
)
- On the popped window, click the
+ New Branch
- Enter the name of your new branch.
- 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.
- Start committing code by clicking the
commit
button in the Git toolbox.
- Edit the commit message and add changed files on the popped window.
You can directly commit the code to the local repository and push to GitHub by clicking the button on the right side of
Commit
.Now it is time to push the code onto Github.