November 14, 2026
A Git Branching Workflow for Modular Projects
Most of my projects split into modules: asset management, dashboards, trend history, report history, alarm history. Several people touch them at once, and the customer always runs a specific version. This is the branching workflow I use to keep that under control. It is Git Flow, trimmed to what a small team actually needs.
The idea in one line
main ← release ← dev ← feature/<module> ← your commits. Nobody commits directly to dev or main.

The branches
| Branch | What it holds | Who writes to it |
|---|---|---|
main | What is running in production. Every commit here is tagged (v1.2.0). | Only a release or hotfix merge |
dev | The integration branch. Always builds, always deployable to a test server. | Only pull requests |
feature/<module> | One piece of work, e.g. feature/asset-management. Short lived. | You |
release/x.y.z | A frozen copy of dev being prepared for a version. Bug fixes only. | The release owner |
hotfix/x.y.z | An urgent fix for production, branched from main. | Whoever fixes it |
Name branches with a / namespace (feature/…, release/…, hotfix/…). Avoid names like dev-asset-management: they look like a second dev, and GitHub cannot group them.
One feature, start to finish

# 01 Start from the latest dev
git switch dev
git pull origin dev
# 02 Create your feature branch
git switch -c feature/asset-management
# 03 Work in small commits
git add .
git commit -m "feat(asset): add asset list API"
# 03 Sync with dev every day or two, so the PR stays small
git fetch origin
git merge origin/dev # or: git rebase origin/dev (before you push)
# 04 Push the branch
git push -u origin feature/asset-management
Then on GitHub:
- Open a pull request
feature/asset-management→dev. - Review and CI: at least one approval, all checks green.
- Squash merge into
dev, then delete the branch. - Back on your machine:
git switch dev && git pull, and start the next feature from there.
Progress inside a feature (the "V1.0, V1.2, V1.3" you might be tempted to name) is just commits. Versions belong to releases, not to features.
Releasing a version, and fixing production

# Planned release
git switch dev && git pull
git switch -c release/1.2.0
# ...only bug fixes and version bumps here...
# PR release/1.2.0 -> main, merge, then tag main:
git switch main && git pull
git tag -a v1.2.0 -m "Release 1.2.0"
git push origin v1.2.0
# PR release/1.2.0 -> dev (back-merge), then delete the branch
# Urgent fix in production
git switch main && git pull
git switch -c hotfix/1.2.1
# ...fix, commit...
# PR hotfix/1.2.1 -> main, tag v1.2.1, and PR hotfix/1.2.1 -> dev
The back-merge into dev is the step people forget. Skip it and the next release quietly brings the bug back.
Six rules
- Protect
mainanddevon GitHub (Settings → Branches): no direct pushes, pull request required, checks must pass. - One feature, one branch, one purpose. If it grows past a week, split it.
- Sync with
devoften. Small merges are boring; a two-week merge is a fight. - Squash merge feature PRs so
devreads as one commit per feature. - Version with tags on
mainusing semantic versioning:MAJOR.MINOR.PATCH. - Notes are not branches. Keep documentation in a
docs/folder or in Issues.
When this is too much
If you work alone and deploy continuously (a website, for example), GitHub Flow is enough: main plus short feature/* branches, and a tag when you want a version. Git Flow pays off when several people build modules in parallel and customers run different versions, which is exactly the IIoT case above.