npx skills add https://github.com/eyadsibai/ltk --skill 'Git Workflows'用于提交、拉取请求、分支管理和变更日志生成的综合性 git 工作流技能。
| 部分 | 用途 | 示例 |
|---|---|---|
| 类型 | 变更类别 | feat, fix, docs |
| 作用域 | 影响的组件 | (auth), (api) |
| 主题 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 简要描述 |
add OAuth2 login |
| 正文 | 详细信息(可选) | 原因 + 变更内容 |
| 页脚 | 引用 | Closes #123 |
| 类型 | 使用时机 |
|---|---|
| feat | 新功能 |
| fix | 错误修复 |
| docs | 仅文档更新 |
| style | 格式调整(无代码变更) |
| refactor | 代码重构 |
| test | 添加/更新测试 |
| chore | 维护、依赖项更新 |
| perf | 性能改进 |
git diff --staged 查看变更| 部分 | 内容 |
|---|---|
| 摘要 | 此 PR 的功能(1-2 句话) |
| 变更 | 具体变更的列表 |
| 测试 | 变更如何被测试 |
| 截图 | 如有 UI 变更 |
| 检查清单 | 测试通过、文档已更新 |
git log main..HEAD --oneline| 分支 | 用途 |
|---|---|
| main | 生产代码 |
| develop | 集成分支 |
| feature/ | 新功能 |
| release/ | 发布准备 |
| hotfix/ | 生产环境修复 |
| 分支 | 用途 |
|---|---|
| main | 始终可部署 |
| 功能分支 | 短期工作分支 |
| 分支 | 用途 |
|---|---|
| main | 所有开发工作 |
| 短期分支 | < 1 天 |
| 功能开关 | 未完成的工作 |
| 模式 | 示例 |
|---|---|
| 功能 | feature/ABC-123-add-user-auth |
| 错误修复 | bugfix/ABC-456-fix-login |
| 热修复 | hotfix/critical-security-patch |
| 发布 | release/v1.2.0 |
| 部分 | 内容 |
|---|---|
| 新增 | 新功能 |
| 变更 | 现有功能的更改 |
| 弃用 | 即将移除的功能 |
| 移除 | 已移除的功能 |
| 修复 | 错误修复 |
| 安全 | 安全修复 |
| 实践 | 原因 |
|---|---|
| 原子提交 | 每次提交一个逻辑变更 |
| 清晰的信息 | 解释原因,而不仅仅是内容 |
| 引用问题 | 链接到相关工单 |
| 签名提交 | GPG 验证 |
| 实践 | 原因 |
|---|---|
| 小型 PR | < 400 行代码便于审查 |
| 清晰的标题 | 总结变更内容 |
| 先自我审查 | 请求审查前先检查差异 |
| 及时响应 | 快速处理反馈 |
| 实践 | 原因 |
|---|---|
| 短期存在 | 几天内合并 |
| 保持更新 | 定期变基 |
| 整洁的历史记录 | 合并前压缩提交 |
| 合并后删除 | 保持仓库整洁 |
| 策略 | 使用时机 | 结果 |
|---|---|---|
| 合并提交 | 保留历史记录 | 合并提交节点 |
| 压缩 | 清理混乱的历史记录 | 单次提交 |
| 变基 | 线性历史记录 | 无合并提交 |
| 快进 | 简单、线性 | 无合并提交 |
关键概念:对于提交记录混乱的功能分支使用压缩。对于整洁的线性历史记录使用变基。当分支历史记录重要时使用合并提交。
| 命令 | 用途 |
|---|---|
git status | 查看暂存/未暂存的变更 |
git diff --staged | 审查将要提交的内容 |
git add -p | 交互式暂存 |
| 命令 | 用途 |
|---|---|
git commit -m "msg" | 提交并附带信息 |
git commit --amend | 修正最后一次提交(推送前) |
| 命令 | 用途 |
|---|---|
git branch -d name | 删除已合并的分支 |
git fetch --prune | 移除过时的远程分支 |
git rebase main | 使用 main 分支更新当前分支 |
| 命令 | 用途 |
|---|---|
git push -u origin branch | 推送并设置上游分支 |
gh pr create | 通过 CLI 创建 PR |
gh pr merge | 通过 CLI 合并 PR |
每周安装数
–
代码仓库
GitHub 星标数
1
首次出现时间
–
安全审计
Comprehensive git workflow skill for commits, pull requests, branching, and changelog generation.
| Part | Purpose | Example |
|---|---|---|
| Type | Category of change | feat, fix, docs |
| Scope | Affected component | (auth), (api) |
| Subject | Brief description | add OAuth2 login |
| Body | Details (optional) | Why + what changed |
| Footer | References | Closes #123 |
| Type | When to Use |
|---|---|
| feat | New feature |
| fix | Bug fix |
| docs | Documentation only |
| style | Formatting (no code change) |
| refactor | Code restructuring |
| test | Adding/updating tests |
| chore | Maintenance, deps |
| perf | Performance improvement |
git diff --staged to see changes| Section | Content |
|---|---|
| Summary | What this PR does (1-2 sentences) |
| Changes | Bullet list of specific changes |
| Testing | How changes were tested |
| Screenshots | If UI changes |
| Checklist | Tests pass, docs updated |
git log main..HEAD --oneline| Branch | Purpose |
|---|---|
| main | Production code |
| develop | Integration branch |
| feature/ | New features |
| release/ | Release preparation |
| hotfix/ | Production fixes |
| Branch | Purpose |
|---|---|
| main | Always deployable |
| feature branches | Short-lived work |
| Branch | Purpose |
|---|---|
| main | All development |
| Short branches | < 1 day |
| Feature flags | Incomplete work |
| Pattern | Example |
|---|---|
| Feature | feature/ABC-123-add-user-auth |
| Bugfix | bugfix/ABC-456-fix-login |
| Hotfix | hotfix/critical-security-patch |
| Release | release/v1.2.0 |
| Section | Content |
|---|---|
| Added | New features |
| Changed | Changes in existing functionality |
| Deprecated | Soon-to-be removed features |
| Removed | Removed features |
| Fixed | Bug fixes |
| Security | Security fixes |
| Practice | Why |
|---|---|
| Atomic commits | One logical change per commit |
| Clear messages | Explain why, not just what |
| Reference issues | Link to related tickets |
| Sign commits | GPG verification |
| Practice | Why |
|---|---|
| Small PRs | < 400 lines ideal for review |
| Clear title | Summarize the change |
| Self-review first | Check diff before requesting |
| Respond promptly | Address feedback quickly |
| Practice | Why |
|---|---|
| Short-lived | Merge within days |
| Up to date | Rebase regularly |
| Clean history | Squash before merge |
| Delete after merge | Keep repo clean |
| Strategy | When to Use | Result |
|---|---|---|
| Merge commit | Preserve history | Merge commit node |
| Squash | Clean up messy history | Single commit |
| Rebase | Linear history | No merge commit |
| Fast-forward | Simple, linear | No merge commit |
Key concept : Squash for feature branches with messy commits. Rebase for clean linear history. Merge commit when branch history matters.
| Command | Purpose |
|---|---|
git status | See staged/unstaged changes |
git diff --staged | Review what will be committed |
git add -p | Interactive staging |
| Command | Purpose |
|---|---|
git commit -m "msg" | Commit with message |
git commit --amend | Fix last commit (before push) |
| Command | Purpose |
|---|---|
git branch -d name | Delete merged branch |
git fetch --prune | Remove stale remotes |
git rebase main | Update branch with main |
| Command | Purpose |
|---|---|
git push -u origin branch | Push and set upstream |
gh pr create | Create PR via CLI |
gh pr merge | Merge PR via CLI |
Weekly Installs
–
Repository
GitHub Stars
1
First Seen
–
Security Audits
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
114,200 周安装