← 返回
未分类 中文

Git Workflow Assistant

Expert-level Git workflow guidance covering branching strategies, commit conventions, merge/rebase workflows, conflict resolution, and CI/CD integration. Use...
专家级 Git 工作流指导,覆盖分支策略、提交规范、合并/变基工作流、冲突解决以及 CI/CD 集成。使用...
ericlooi504 ericlooi504 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 286
下载
💾 0
安装
1
版本
#latest

概述

Git Workflow Assistant

Branching Strategies

When to use what:

StrategyBest forKey structures
------------------------------------
GitHub FlowContinuous deployment, small teamsmain + feature branches → PR → deploy
GitFlowRelease cycles, multiple versionsmaindevelopfeature/release/hotfix/*
Trunk-basedCI/CD, large teamsShort-lived feature branches → merge to main daily
GitLab FlowEnvironments per branchmainpre-productionproduction

Commit conventions

Follow Conventional Commits: ():

feat: add user authentication
fix(api): handle null response from payment gateway
chore(deps): upgrade express to 4.18
docs(readme): update installation guide
refactor(db): extract query builder
test(auth): add login flow tests

Common Workflows

Feature branch → PR

git checkout -b feat/my-feature main
# ... code, commits ...
git push -u origin feat/my-feature
# → Open PR on GitHub/GitLab/Azure DevOps

Rebase before merge (linear history)

git fetch origin
git rebase origin/main
# fix conflicts if any
git push --force-with-lease

Interactive rebase (squash/split)

git rebase -i HEAD~3
# pick, squash, reword, edit as needed
git push --force-with-lease

Conflict Resolution

Strategy:

  1. git merge → resolve conflicts in files
  2. Mark resolved: git add
  3. Continue: git merge --continue

For rebase conflicts:

git rebase --continue   # after resolving each step
git rebase --abort      # to cancel
git rebase --skip       # to skip a commit

Recovery

  • Undo last commit (keep changes): git reset --soft HEAD~1
  • Undo last commit (discard changes): git reset --hard HEAD~1
  • Recover deleted branch: git reflog → find SHA → git checkout -b
  • Undo a pushed commit: git revert (safe for shared branches)

Useful Aliases

git config --global alias.lg "log --oneline --graph --decorate --all"
git config --global alias.undo "reset --soft HEAD~1"
git config --global alias.amend "commit --amend --no-edit"

References

See references/workflows.md for detailed workflow patterns.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-08 04:00 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,118
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 198 📥 68,231
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 686 📥 331,078