Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

git-workflow-mastery掌握 git 工作流程

Agent Skill

git-workflow-mastery 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

247

周安装

10

GitHub Stars

公开资料未说明

下载量

78
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:git-workflow-mastery(掌握 git 工作流程)
来源仓库:https://github.com/autohandai/community-skills
仓库路径:skills/git-workflow-mastery
安装命令:
npx skills add https://github.com/autohandai/community-skills --skill git-workflow-mastery
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/autohandai/community-skills --skill git-workflow-mastery

简介

git-workflow-mastery 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词或任务场景快速定位候选结果时使用。

  • 适用于需要掌握高级技巧、应对复杂场景或传授经验给其他 Agent 的场景。
  • 通过 GitHub 仓库安装,使用 npx skills add 命令添加,需结合原始 README 了解具体调用方式。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Git Workflow Mastery

Branching Strategies

GitHub Flow (Simple)

main ────●────●────●────●────●────
              \         /
feature        ●───●───●

Best for: Continuous deployment, small teams

Git Flow (Structured)

main    ────●─────────────────●────
             \               /
release       ●─────●───────●
               \   /
develop ────●───●───●───●───●────
             \     /
feature       ●───●

Best for: Scheduled releases, larger teams

Branch Naming

# Feature branches
feature/user-authentication
feature/JIRA-123-add-login

# Bug fixes
fix/login-redirect-loop
fix/JIRA-456-null-pointer

# Releases
release/v1.2.0
release/2024-q1

# Hotfixes
hotfix/security-patch
hotfix/v1.2.1

Commit Messages

Conventional Commits

<type>(<scope>): <description>

[optional body]

[optional footer(s)]

Types

feat:     # New feature
fix:      # Bug fix
docs:     # Documentation only
style:    # Formatting, no code change
refactor: # Code change without feature/fix
perf:     # Performance improvement
test:     # Adding/updating tests
chore:    # Build process, dependencies
ci:       # CI configuration
revert:   # Revert previous commit

Examples

# Simple
feat(auth): add OAuth2 login support

# With body
fix(api): handle null response from external service

The external payment API occasionally returns null
instead of an error object. Added defensive check.

Fixes #234

# Breaking change
feat(api)!: change response format to JSON:API

BREAKING CHANGE: All API responses now follow JSON:API spec.
Clients need to update their parsers.

Common Operations

Interactive Rebase

# Squash last 3 commits
git rebase -i HEAD~3

# In editor:
pick abc1234 First commit
squash def5678 Second commit
squash ghi9012 Third commit

Cherry Pick

# Apply specific commit to current branch
git cherry-pick abc1234

# Cherry pick range
git cherry-pick abc1234..def5678

Stashing

# Save work in progress
git stash push -m "WIP: feature login"

# List stashes
git stash list

# Apply and remove
git stash pop

# Apply specific stash
git stash apply stash@{2}

Undoing Changes

# Undo last commit (keep changes)
git reset --soft HEAD~1

# Undo last commit (discard changes)
git reset --hard HEAD~1

# Undo a pushed commit (new revert commit)
git revert abc1234

# Discard all local changes
git checkout -- .
git clean -fd

Advanced Techniques

Bisect (Find Bug Introduction)

git bisect start
git bisect bad           # Current commit is broken
git bisect good v1.0.0   # Known good commit

# Git checks out middle commit
# Test and mark:
git bisect good  # or
git bisect bad

# Continue until bug found
git bisect reset

Reflog (Recover Lost Commits)

# View reflog
git reflog

# Recover deleted branch
git checkout -b recovered-branch abc1234

# Undo hard reset
git reset --hard HEAD@{2}

Worktrees (Multiple Working Directories)

# Create worktree for feature branch
git worktree add ../feature-branch feature/new-ui

# List worktrees
git worktree list

# Remove worktree
git worktree remove ../feature-branch

Hooks

Pre-commit Hook

#!/bin/sh
# .git/hooks/pre-commit

# Run linter
npm run lint
if [ $? -ne 0 ]; then
  echo "Lint failed. Commit aborted."
  exit 1
fi

# Run tests
npm test
if [ $? -ne 0 ]; then
  echo "Tests failed. Commit aborted."
  exit 1
fi

Commit-msg Hook

#!/bin/sh
# .git/hooks/commit-msg

# Validate conventional commit format
commit_regex='^(feat|fix|docs|style|refactor|perf|test|chore|ci|revert)(\(.+\))?: .{1,72}'

if ! grep -qE "$commit_regex" "$1"; then
  echo "Invalid commit message format."
  echo "Use: type(scope): description"
  exit 1
fi

Git Aliases

# ~/.gitconfig
[alias]
  co = checkout
  br = branch
  ci = commit
  st = status
  lg = log --oneline --graph --decorate
  undo = reset --soft HEAD~1
  amend = commit --amend --no-edit
  wip = !git add -A && git commit -m 'WIP'
  sync = !git fetch origin && git rebase origin/main

Best Practices

  1. Commit early, commit often - Small, focused commits
  2. Write meaningful commit messages - Explain why, not just what
  3. Keep main/master deployable - Always in working state
  4. Review before merging - Use pull requests
  5. Delete merged branches - Keep repository clean
  6. Never rewrite shared history - No force push to shared branches
  7. Use tags for releases - Semantic versioning

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

25.77%
按下载量换算20

windsurf

24.37%
按下载量换算19

trae

16.83%
按下载量换算13

OpenCode

12.46%
按下载量换算10

Codex

7.32%
按下载量换算6

Antigravity

3.21%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills