提交
- 作者仓库星标 0
- 作者仓库 Garden
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @001eander · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- Docker
- 运行环境要求
- Docker
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
feat(auth): add OAuth2 support
Implement Google and GitHub authentication with JWT tokens.
Add social login buttons to UI.
Closes #123
> License: MIT
# Git Commit Skill
Write meaningful git commits using conventional commit format to improve collaboration, enable automation, and maintain clean project history.
## Commit Format
```
<type>(<scope>): <subject>
<body>
<footer>
```
### Commit Types
- **feat**: New feature for users
- **fix**: Bug fix for users
- **docs**: Documentation changes
- **style**: Code style (formatting, etc)
- **refactor**: Code restructuring
- **test**: Test additions/modifications
- **chore**: Maintenance tasks
- **perf**: Performance improvements
- **build**: Build system changes
- **ci**: CI configuration changes
- **revert**: Revert previous commit
### Subject Line Rules
- Use imperative mood: "Add feature" not "Added feature"
- First letter capitalized, no period at end
- Max 50 characters
- Describe what the commit does
### Body Guidelines
- Explain **why** the change was made
- Use bullet points for multiple changes
- Reference related issues: `Closes #123`, `Fixes #456`
- Max 72 characters per line
### Footer Elements
- Breaking changes: `BREAKING CHANGE: description`
- Issue references: `Closes #123`, `Fixes #456`
- Co-authors: `Co-authored-by: name <email>`
## Examples
**Feature with issue reference:**
```
feat(auth): add OAuth2 support
Implement Google and GitHub authentication with JWT tokens.
Add social login buttons to UI.
Closes #123
```
**Bug fix with explanation:**
```
fix(api): resolve null pointer in user endpoint
Add null check for user object before accessing properties.
Root cause: Missing validation in user lookup function.
Fixes #456
```
**Documentation update:**
```
docs(readme): update installation instructions
Add Docker installation option.
Document required environment variables.
```
## Workflow
1. **Stage selectively**: `git add -p`
2. **Review changes**: `git diff --cached`
3. **Write message**: Follow conventional format
4. **Commit**: `git commit -m "type(scope): subject" -m "body"`
5. **Verify**: `git log --oneline -1`
## Automation Tools
### Commitizen
Interactive commit message writing:
```bash
git add . && git cz
```
### commitlint
Validate commit messages:
```javascript
// commitlint.config.js
module.exports = {extends: ['@commitlint/config-conventional']}
```
### Conventional Changelog
Generate changelog from commits:
```bash
conventional-changelog -p angular -i CHANGELOG.md -s
```
### Semantic Release
Automated versioning based on commit types.
## Git Hooks
### commit-msg Hook
Validate commit message format in `.git/hooks/commit-msg`.
### pre-commit Hook
Run tests and linting before commit:
```bash
npm test && npm run lint
```
## Best Practices
- Make atomic commits - one logical change per commit
- Write meaningful subject lines
- Explain reasoning in body, not just what changed
- Reference related issues
- Note breaking changes clearly
- Use interactive staging: `git add -p`
- Rebase for clean history: `git rebase -i HEAD~5`
- Sign important commits: `git commit -S`
## Quick Reference
### Common Commands
```bash
git commit -m "type(scope): subject"
git commit --amend
git add -p
git rebase -i HEAD~5
git log --oneline --graph --decorate
```
### Common Scopes
- `auth` - Authentication
- `api` - API endpoints
- `ui` - User interface
- `db` - Database
- `docs` - Documentation
## Templates & References
See `templates/` directory for:
- `commit-message-template.md` - Complete commit templates
- `git-hook-examples.md` - Git hook implementations
See `references/` directory for:
- `conventional-commits.md` - Specification details
- `semantic-versioning.md` - Version bump mapping
- `workflow-best-practices.md` - Team workflows
章节与文件索引
按说明文件中的顺序排列。
提交类型
主题行规则
身体指南
页脚元素
示例
文件/命令 -> Closes #123 · Fixes #456 · BREAKING CHANGE: description · Co-authored-by: name <email> · git add -p · git diff --cached · git commit -m "type(scope): subject" -m "body" · git log --oneline -1
内容校验值 -> e2d290c18420
当前原文的自动摘译,尚未人工审校。
提交类型
壮举:为用户修复的新功能:为用户修复错误文档:文档更改样式:代码样式(格式等)重构:代码重组
主题行规则
使用祈使语气:“添加功能”而不是“添加功能”首字母大写,末尾无句点 最多 50 个字符 描述提交的作用
身体指南
解释为什么进行更改 对多项更改使用项目符号 参考相关问题:
Closes #123、Fixes #456每行最多 72 个字符页脚元素
重大变更:
BREAKING CHANGE: description问题参考:Closes #123、Fixes #456共同作者:Co-authored-by: name <email>示例
具有问题参考的功能:错误修复及说明:文档更新: