Skip to content

Git styleguide

Magno F. B. Biét edited this page Mar 8, 2022 · 11 revisions

Branch

gitflow

Commit

The reasons for these conventions

  • Automatic generating of the changelog
  • Provide better information when browsing the history

Format of the commit message

<type>(<scope>): <subject>

<body>

<footer>

<type> values

build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test

Message <body>, <subject>

Uses the imperative, present tense: "change" not "changed" nor "changes".

Message <footer>

Referencing issues

Generating CHANGELOG.md

List of all subjects since the last release

git log <LAST_TAG> HEAD --pretty=format:%s

New features in this release

git log <LAST_RELEASE> HEAD --grep feat

Message template

cd ~
wget -c https://raw.githubusercontent.com/magnobiet/my-coding-style/master/.gitmessage
git config --global commit.template ~/.gitmessage

Global .gitignore

cd ~
wget -c https://www.gitignore.io/api/windows,linux,macos,archives -O .gitignore_global
git config --global core.excludesfile ~/.gitignore_global

References