April 9, 2022

Commits Best Practices

Posted on April 9, 2022  • 
3 minutes  •
465 words

1. First of all :

You can change it by doing so : git config --global core.editor "editor name"

For vsCode users simply do git config --global core.editor "code --wait"

As this article says . What it will do is open up a vsCode window when you want to write your commit mesage’s Title and Body.

2. Structure of the commit

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
#
# Initial commit
#
# Changes to be committed:
#       new file:   kern.asm
#       new file:   kert.c
#       new file:   link.ld
#

Here you can see the files that will be commited and other infos.

What you’ll do is

Here’s an example of what it would look like:

[feat] add version one of the mini kernel

This is the commit description, you can put here additional info you want other contributors to know about the modifications
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
#
# Initial commit
#
# Changes to be committed:
#       new file:   kern.asm
#       new file:   kert.c
#       new file:   link.ld
#

3. HOW TO WRITE A GOOD COMMIT

[feat]: introduce a new feature
[fix]: patches a bug in your codebase (bugfix or hotfix)
[build]: changes that affect the build system or external dependencies
[chore]: updates dependencies and does not relate to fix or feat and does not modify src or test files
[ci]: changes that affect the continuous integration process
[docs]: updates the documentation or introduce documentation
[style]: updates the formatting of code; remove white spaces, add missing spaces, remove unnecessary newlines
[refactor]: reactors code segments to optimize readability without changing behavior
[perf]: improve performance
[test]: add/remove/update tests
[revert]: reverts one or many previous commits
[feat] add negamax.
[fix] negamax infinite looping issue

* the problem was blablabla
Follow us

We do everything from projects, lectures, courses, workshops and events. Follow us closely to know more !