| ... | ... | @@ -79,7 +79,7 @@ repository is either ssh or https address of the repo. |
|
|
|
|
|
|
|
A commit is like a checkpoint : you have modified multiple files, and you [push](#push) them to the [origin](#origin) with a commit message like "hey I've done this and that".
|
|
|
|
|
|
|
|
A commit can but doesn't have to contain all your modified files, it will only include [added](#add) files. Any commit will be accompanied by a **commit message** that NEEDS to contain the important things that has been modified in the added files.
|
|
|
|
A commit will contain the files [added](#add) to it. Any commit will be accompanied by a **commit message** that NEEDS to contain the important things that has been modified in the added files.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git commit
|
| ... | ... | @@ -87,18 +87,30 @@ git commit |
|
|
|
|
|
|
|
Each git commit can then bee seen in your history using git log.
|
|
|
|
|
|
|
|
It is important to keep a commit history clean as it will help maintainers of the repository.
|
|
|
|
|
|
|
|
#### How to make a proper commit ?
|
|
|
|
|
|
|
|
##### How to write a commit message ?
|
|
|
|
|
|
|
|
:warning:To help with the readability of the commit history, every git message MUST [follow the convention](https://www.conventionalcommits.org/en/v1.0.0/)
|
|
|
|
:warning: To help with the readability of the commit history, every git message MUST [follow the convention](https://www.conventionalcommits.org/en/v1.0.0/) :
|
|
|
|
|
|
|
|
```text
|
|
|
|
Chore : This is a commit message example. This line will serve as commit title.
|
|
|
|
Either prefix your commit with :
|
|
|
|
|
|
|
|
The following Lines will be used to provide more context to someone that wants to inspect this given commit.
|
|
|
|
Users are urged to provide as much context as possible in their commits.
|
|
|
|
```
|
|
|
|
* `feat :` if its a new feature bringing something new to the other branches.
|
|
|
|
* `chore :` if it is something that doesn't impact the program, enhancing error message, filling a `README.md` ...
|
|
|
|
* `fix :` If you are fixing something that was broken IN OTHER BRANCHES.
|
|
|
|
|
|
|
|
If you just created a new object in a branch, then you commit, and then realize the tests do not pass and create a fix commit about the feature you just implemented, you will need [to squash this commit with the previous feature commit](https://gitlab.eclipse.org/groups/eclipse/aidge/-/wikis/Get-good-at-git?edit=true#rebase) before merging your repo.
|
|
|
|
|
|
|
|
> **Example :**
|
|
|
|
>
|
|
|
|
> ```text
|
|
|
|
> Chore : This is a commit message example. This line will serve as commit title.
|
|
|
|
>
|
|
|
|
> The following Lines will be used to provide more context to someone that wants to inspect this given commit.
|
|
|
|
> Users are urged to provide as much context as possible in their commits.
|
|
|
|
> ```
|
|
|
|
|
|
|
|
##### What should a commit contain ?
|
|
|
|
|
| ... | ... | |