Git Workflow Guide
This document outlines the professional branching and release strategy for Elo Orgânico, combining the structural discipline of Git Flow with the collaboration power of the GitHub CLI (gh).
Branching Model
We follow the standard Git Flow model to ensure the stability of our production code, adapted for our monorepo structure.
| Branch | Purpose | Stability |
|---|---|---|
main | Production releases. Every commit is a tagged release. | Ultra Stable |
develop | Next release development. Integration branch. | Stable |
feature/* | New features or UI changes. Branch off develop. | Experimental |
bugfix/* | Bug fixes for the next development cycle. | Experimental |
release/* | Preparation for a new production release. | Final Polish |
hotfix/* | Critical bug fixes for the production version. | Urgent |
support/* | Long-term support branches for older major releases. | Stable |
Git Flow CLI Configuration
Our local repository is configured with the following prefixes and tag rules:
Branch name for production releases: main
Branch name for "next release" development: develop
Feature branch prefix: feature/
Bugfix branch prefix: bugfix/
Release branch prefix: release/
Hotfix branch prefix: hotfix/
Support branch prefix: support/
Version tag prefix: v
Tooling Requirements
To follow this workflow efficiently, we recommend:
- Git Flow CLI (AVH Edition): Usually included in Git for Windows or available via
gitflowpackage. - GitHub CLI (
gh): Used for Pull Requests, status monitoring, and official releases.
Commit Standards (Conventional Commits)
To maintain a clean and automated history, all commits must follow the Conventional Commits specification.
Format: <type>(<scope>): <description>
Types
- feat: A new feature (correlates with
MINORin SemVer). - fix: A bug fix (correlates with
PATCHin SemVer). - docs: Documentation only changes.
- style: Changes that do not affect the meaning of the code (white-space, formatting, etc).
- refactor: A code change that neither fixes a bug nor adds a feature.
- perf: A code change that improves performance.
- test: Adding missing tests or correcting existing tests.
- chore: Changes to the build process or auxiliary tools/libraries.
Monorepo Scopes
Use the context or package name as the scope:
instance: Changes to the Community Instance apps or core.portal: Changes to the Global Portal apps or core.core: Changes to shared domain logic.studio: Design tokens, assets, or Penpot configuration.tools: MCP servers, scripts, or infrastructure.deps: Dependency updates (managed via catalogs).
Example: feat(instance): add Pix payment reconciliation to checkout
Contribution Workflow
1. Starting a New Feature
Always branch off from develop.
git flow feature start my-awesome-feature
2. Collaborating and Proposing Changes
Instead of merging locally, we use Pull Requests for code review and CI validation.
- Push your branch:
git push -u origin feature/my-awesome-feature - Create a Pull Request:
Usegh pr create --base develop --fill --web
--fillto automatically use your commit messages for the PR description.
3. Senior Merge Strategy (Squash & Merge)
To keep the develop history clean and meaningful, we use Squash Merges. This combines all commits from a feature branch into a single, well-described commit in develop.
- Action: Merge via GitHub UI or CLI using the
squashmethod. - CLI Command:
gh pr merge --squash --delete-branch
Release & Versioning Workflow (Changesets)
We use Changesets combined with GitHub Actions to automate our versioning, changelog compilation, and release Pull Requests. Developers do not bump package versions manually in package.json files.
1. Generating a Changeset (Local)
When your feature or bug fix is ready and before opening a Pull Request:
- Run the interactive changeset tool from the repository root:
pnpm version:changeset
- Select the package(s) that were modified using the spacebar.
- Choose the appropriate SemVer bump level (Major for breaking changes, Minor for new backwards-compatible features, or Patch for bug fixes).
- Provide a clear, technical description of the change (in English, conforming to our commit standards).
- A temporary markdown file will be created under the
.changeset/directory (e.g.,.changeset/warm-dogs-run.md). - Commit this markdown file alongside your code and push it with your feature branch.
Create one changeset per isolated change. If a feature branch has multiple independent fixes or additions, you can run pnpm version:changeset multiple times to generate separate notes for each.
2. Automated Versioning Pipeline (GitHub Actions)
Our CI/CD workflow handles the version bumping automatically when code is integrated:
- Pull Request & Integration: Developers open a Pull Request targeting the
developbranch. - Merge to
develop: Once approved and merged intodevelop, the Manage Version Bumps and Releases GitHub Action is triggered. - Release PR Generation:
- The workflow parses the
.changeset/*.mdfiles present in the branch. - It calculates the new versions, consumes (deletes) the temporary changeset markdown files, bumps the respective
package.jsonfiles, and updates the local package changelogs. - It automatically commits these changes and creates (or updates) an open Pull Request on GitHub named
chore(release): version packagestargetingdevelop.
- The workflow parses the
3. Finalizing the Release (Maintainers Only)
To publish and finalize the release:
- Open the automated Pull Request
chore(release): version packagesin GitHub. - Review the compiled version changes and changelogs.
- Merge the Pull Request into
develop. Because the changeset files have already been consumed and deleted, merging this PR consolidates the bumped package versions in the repository.
Never edit the "version" field in a package's package.json manually during a normal feature branch. Always rely on pnpm version:changeset and let the GitHub Action pipeline manage the releases.
Critical Fixes (Hotfixes)
If a bug is found in production:
git flow hotfix start fix-crash- Apply the fix and finish:
git flow hotfix finish fix-crash - Sync both
mainanddevelop.
Prohibited Practices
- No direct commits to
mainordevelop: Always use feature branches and PRs. - No Force Pushes: Unless on your own isolated feature branch and required for a rebase.
- No Dirty Merges: Avoid merging
mainback intofeature/*. Always rebase ontodevelopif your feature branch becomes outdated.
Adherence to this workflow ensures a clean history and high-quality software distribution.