git-workflow
Git commit message conventions, branch naming and clean-history workflow. Use when committing, branching, rebasing, tagging or reviewing git history.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- git-workflow
- rules
- [ "file(.git)" ]
- title
- Git Workflow: Commits, Branches, Rebasing
- domains
- developer devops
- license
- Apache-2.0
- description
- Git commit message conventions, branch naming and clean-history workflow. Use when committing, branching, rebasing, tagging or reviewing git history.
- capabilities
- versioning
- compatibility
- Requires git. Works with any git-based project.
03 SKILL.md 正文
Overview
This skill encodes git commit conventions (Conventional Commits), branch naming rules, and workflow best practices. Activate it when you need to commit changes, name a branch, clean up history, or review git practices in a project.
Instructions
Commit Message Format
Follow Conventional Commits 1.0.0:
<type>(<scope>): <short summary>
[optional body]
[optional footer]
Types: the spec itself defines only feat (maps to a SemVer MINOR) and fix (PATCH). The common extended set comes from commitlint's config-conventional:
feat— new featurefix— bug fixrefactor— code change that neither fixes a bug nor adds a featureperf— performance improvementtest— adding or updating testsdocs— documentation onlystyle— formatting, no behavior changebuild— build system or dependenciesci— CI/CD changeschore— other maintenancerevert— reverts a previous commit
If the repo already enforces a type list (commitlint config, CONTRIBUTING), that list wins.
Breaking changes (MAJOR): add ! right before the colon — feat(api)!: drop v1 endpoints — and/or a footer BREAKING CHANGE: <what breaks and how to migrate>. The footer token is uppercase; BREAKING-CHANGE is equivalent.
Rules:
- Summary line: imperative mood ("add" not "added"), aim for ~50 characters, hard limit 72
- No period at end of summary
- Body: wrap at 72 characters, explain why not what
- Footers use
Token: valuewith hyphenated tokens (Reviewed-by:,Co-authored-by:,Signed-off-by:); reference issues asFixes #123/Closes #456so the forge auto-closes them
Branch Naming
<type>/<short-description>
feat/user-profile-pagefix/login-redirect-looprefactor/extract-auth-middlewarechore/upgrade-tokio-1.47
Use kebab-case. Keep it short but descriptive. Match the commit type.
Workflow Rules
- Never commit directly to
main— always use a short-lived branch - Keep commits atomic — one logical change per commit
- Update your branch by rebasing onto the fresh remote:
git fetch origin && git rebase origin/main. Rebase only branches nobody else has built on - After rewriting a pushed branch, push with
git push --force-with-lease --force-if-includes— never plain--force - Clean up before opening a PR: make corrections as
git commit --fixup=<sha>, then fold them withgit rebase --autosquash origin/main(Git 2.44+ applies autosquash without-i, so it runs non-interactively) - Stacked branches:
git rebase --update-refsmoves every branch in the stack in one pass - Tag releases with semantic versioning (
v1.2.3), annotated (-a) or signed (-s)
Examples
Good commit message
feat(auth): add JWT refresh token rotation
Prevents token reuse after logout by invalidating the previous
refresh token on each use.
Closes #89
Bad commit message → fix it
# Bad
fixed stuff
update
WIP
# Good
fix(api): handle empty response body in error parser
The parser panicked when the server returned a 500 with no body.
Added a fallback to use the status text instead.
Common commands
# Start a feature (git switch replaces checkout for branches)
git switch -c feat/my-feature
# Stage only relevant changes (interactive; agents stage explicit paths instead)
git add -p
# Amend last commit (before push)
git commit --amend --no-edit
# Fix an earlier commit, then fold it in without an editor
git commit --fixup=<sha>
git rebase --autosquash origin/main
# Check what will be committed
git diff --staged
# Tag a release
git tag -a v1.2.3 -m "Release v1.2.3"
git push origin v1.2.3
References
04 同仓库更多 Skills
seo-content-refresh
Finds decaying pages, picks update, merge, redirect or remove, and briefs each refresh. Use to prioritize existing content and judge whether it helped.
marketing-review-program
Plans how to ask real customers for honest public reviews: site choice, invitation copy, incentive and disclosure rules. Use to start a review program.
geo-source-actions
Turns AI citation findings into ranked per-source actions for Reddit threads, listicles, review sites and videos. Records only. Use after a GEO audit.
commerce-ai-readiness
Audits product feeds, markup and live pages for AI shopping assistants, then lists exact fixes. Use to make a store catalog readable to AI shoppers.
tap-model-training
Train, evaluate and publish the octomind-embed model behind capability auto-activation. Use when capability triggers or skill semantic() phrases change.
tap-deps-authoring
Write dep scripts for the octomind-tap registry: header comments, platform.sh, mcp vs dep types, npx/uvx pattern. Use when editing deps/<org>/<tool>.sh.