Git Conventions

GitFlow Branching model

The Decidim respository follows the GitFlow branching model. There are good documentations on it at:

This model introduces the develop branch as a kind of queue for new features to enter into the next release.

In summary, Decidim developers that work on feature/... or fix/... branches will branch off from develop and must be merged back into develop.

Then, to start a new feature branch off from develop in the following way:

git checkout develop
git checkout -b feature/xxx

Implement the feature, and open a Pull Request as normal, but against develop branch. As this is the most common operation, develop is the default branch instead of master.

Naming branches

We would like to have all branches following this namings:

Branch prefix Comment

chore/

Internal work. For instance, automatisms, etc. No production code change.

ci/

For continous integration related tasks. No production code change.

deps/

For dependency management tasks.

doc/

For changes to the documentation.

feature/

For new features for the users or for the Decidim command.

fix/

For feature bugfixing.

release/

With MAYOR.MINOR-stable. For instance, release/0.22-stable

refactor/

For refactorings related with production code.

test/

When adding missing tests, refactoring tests, improving coverage, etc.

backport/

We only offer support for the last mayor version.

Git commit messages and Pull Request titles

We recommend following this guide for making good git commit messages. It also applies to Pull Request titles. The summary is:

  1. Separate subject from body with a blank line

  2. Limit the subject line to 50 characters

  3. Capitalize the subject line

  4. Do not end the subject line with a period

  5. Use the imperative mood in the subject line

  6. Wrap the body at 72 characters

  7. Use the body to explain what and why vs. how