with one click
git-flow
// Git branch model for the tyutool repository, covering branch creation, merging, releases, and hotfixes. Triggers on git-flow, branch management, release, feature, hotfix, and related keywords.
// Git branch model for the tyutool repository, covering branch creation, merging, releases, and hotfixes. Triggers on git-flow, branch management, release, feature, hotfix, and related keywords.
| name | git-flow |
| description | Git branch model for the tyutool repository, covering branch creation, merging, releases, and hotfixes. Triggers on git-flow, branch management, release, feature, hotfix, and related keywords. |
tyutool is a firmware flash tool for Tuya-class IoT devices. Release artifacts: CLI binaries (5 platforms) and a desktop GUI (Tauri 2).
hotfix โโโโโโโโโโ โโโโโ hotfix
โผ โผ
master โโโโโโโโโโโโโโโโโโโโโโโโโ โ v2.x stable (archived, hotfix only)
refactor/v3 โโโโโโโโโโโโโโโโโโโโ โ v3 main dev branch (currently active)
\ \
<id>/* โโโโโโโโโ โโโโโ โ personal branches (<initials>/<description>)
v3.x.x tags are pushed directly onto
refactor/v3commits. CI triggers the build and auto-writes the version bump back.
| Branch | Role | Rules |
|---|---|---|
refactor/v3 | v3 dev integration branch (current trunk) | No direct push; personal branches merged via MR after local validation |
master | v2.x stable (archived) | Accepts hotfix/* MRs only, maintains the v2 series |
| Type | Format | Base | Target | Purpose |
|---|---|---|---|---|
| Feature | <initials>/<description> | refactor/v3 | refactor/v3 | Day-to-day feature work |
| Hotfix (v2) | hotfix/<description> | master | master | Urgent fixes for published v2 releases |
<initials>is the developer's name initials, e.g.ab. Description: kebab-case English, e.g.ab/serial-debug-scroll,ab/add-new-chip.
Is this an urgent bug in a published v2 release (master / v2.x tag)?
โโ Yes โ hotfix/<description> (based on master)
โโ No โ <initials>/<description> (based on refactor/v3)
# Create personal branch from refactor/v3
git checkout refactor/v3 && git pull origin refactor/v3
git checkout -b ab/my-feature
# Develop & commit (follow commit convention)
git add src/features/firmware-flash/chip-manifests.ts
git commit -m "feat(firmware-flash): add new chip manifest"
# Sync trunk periodically to keep linear history
git fetch origin
git rebase origin/refactor/v3
# Push
git push -u origin ab/my-feature
# Validate locally (see release checklist) โ open MR into refactor/v3
# Step 1: ensure refactor/v3 is up-to-date and stable
git checkout refactor/v3 && git pull origin refactor/v3
# Step 2: local validation
pnpm run lint && pnpm run build
cargo test -p tyutool-core && cargo test -p tyutool-cli
# Step 3: push tag โ CI triggers build + auto version bump
git tag v3.1.0
git push origin v3.1.0
# CI automatically:
# 1. Builds CLI binaries for 5 platforms + Tauri GUI
# 2. Creates GitHub Release with all artifacts
# 3. Commits version bump to refactor/v3 (chore: bump version to 3.1.0 [skip ci])
Do not manually edit version files โ
scripts/bump-version.mjsupdates all of them:package.json,src-tauri/tauri.conf.json,src-tauri/Cargo.toml,crates/*/Cargo.toml
Trigger workflow_dispatch in GitHub Actions. CI will:
package.json; artifact filenames get a .beta suffix# Step 1: create hotfix branch from master
git checkout master && git pull origin master
git checkout -b hotfix/uart-baud-crash
# Step 2: fix & bump version manually (v2 has no CI write-back)
node scripts/bump-version.mjs 2.3.3
git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml \
crates/tyutool-core/Cargo.toml crates/tyutool-cli/Cargo.toml
git commit -m "chore: bump version to 2.3.3"
git add crates/tyutool-core/src/serial.rs
git commit -m "fix(serial): guard against zero baud rate in port open"
# Step 3: push and open MR โ master
git push -u origin hotfix/uart-baud-crash
# Step 4: after master MR merges, tag to trigger CI
git checkout master && git pull
git tag v2.3.3
git push origin v2.3.3
Format: <type>(<scope>): <message>, message โค 72 characters.
| type | meaning |
|---|---|
feat | new feature |
fix | bug fix |
chore | build, deps, config (no functional change) |
docs | documentation |
refactor | refactor (no behavior change) |
style | formatting (whitespace, newlines โ no logic change) |
ci | CI/CD config changes |
build | build system or external dependency changes |
Common scopes: cli, firmware-flash, serial-debug, gui, auth, ci, release
feat(firmware-flash): add new chip manifest
fix(cli): handle missing baud rate in write command
chore: bump version to 3.1.0 [skip ci]
refactor(serial-debug): convert ws-transport dynamic import to static
ci(release): add aarch64 macOS build target
Semantic version v<major>.<minor>.<patch>:
| Change | Bump | Example |
|---|---|---|
| Breaking change / major rewrite | major | v3.x.x โ v4.0.0 |
| New feature (backward-compatible) | minor | v3.0.x โ v3.1.0 |
| Bug fix / hotfix | patch | v3.0.6 โ v3.0.7 |
v3.x: CI manages version files automatically โ push tag = release. v2.x (master): run
node scripts/bump-version.mjsmanually before tagging.
Before pushing a v3 tag (on refactor/v3):
pnpm run lint passes (no TypeScript/ESLint errors)pnpm run build succeedscargo test -p tyutool-core passescargo test -p tyutool-cli passespnpm run tauri:dev starts correctly; core path works (select port, select firmware, flash)git status to confirm a clean working treerefactor/v3; v2 hotfixes base off masterab/)git rebase origin/refactor/v3 on personal branches to maintain linear historyrefactor/v3 or master โ always use an MRgit tag v3.x.x && git push origin v3.x.xnode scripts/bump-version.mjs <version> to update all filesgit revert (preserves history)--force without explicit confirmationFull scenario walkthroughs, conflict resolution strategies, and FAQs: reference.md.