[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70G27HSKXKBJ62STKWJ9JKD":3,"skill-same:01M70G27HSKXKBJ62STKWJ9JKD":76},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":6,"ownerDescription":60,"updatedAt":61,"install":62,"resources":75},"01M70G27HSKXKBJ62STKWJ9JKD","git-workflow",null,"Git workflow patterns including branching strategies, commit conventions, keeping history clean and readable, tidying local commits before merging, merge vs rebase, conflict resolution, and collaborative development best practices for teams of all sizes. Use when choosing a branching strategy, writing commit conventions, cleaning up history before a pull request, deciding merge versus rebase, or resolving conflicts.","mdnaimul22\u002Fhuman-skills","mdnaimul22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F64520358?v=4","01M70FH95MH2H796Q01TYSFZ03","Naimul","01M70FH96798CQR4YHA13F17GA",3,"MIT","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Fgit-workflow\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"git","workflow","git workflow","up","branching strategy","best practices","use","strategy","workflow patterns","for","commits","conflict","rebase","commit conventions","strategies","conflicts","writing","clean","local","conflict resolution","2026-11-10 10:12:30",false,"---\nname: git-workflow\ndescription: Git workflow patterns including branching strategies, commit conventions, keeping history clean and readable, tidying local commits before merging, merge vs rebase, conflict resolution, and collaborative development best practices for teams of all sizes. Use when choosing a branching strategy, writing commit conventions, cleaning up history before a pull request, deciding merge versus rebase, or resolving conflicts.\nmetadata:\n  origin: ECC\n---\n\n# Git Workflow Patterns\n\nBest practices for Git version control, branching strategies, and collaborative development.\n\n## When to Activate\n\n- Setting up Git workflow for a new project\n- Deciding on branching strategy (GitFlow, trunk-based, GitHub flow)\n- Writing commit messages and PR descriptions\n- Resolving merge conflicts\n- Managing releases and version tags\n- Onboarding new team members to Git practices\n\n## Branching Strategies\n\n### GitHub Flow (Simple, Recommended for Most)\n\nBest for continuous deployment and small-to-medium teams.\n\n```\nmain (protected, always deployable)\n  │\n  ├── feature\u002Fuser-auth      → PR → merge to main\n  ├── feature\u002Fpayment-flow   → PR → merge to main\n  └── fix\u002Flogin-bug          → PR → merge to main\n```\n\n**Rules:**\n- `main` is always deployable\n- Create feature branches from `main`\n- Open Pull Request when ready for review\n- After approval and CI passes, merge to `main`\n- Deploy immediately after merge\n\n### Trunk-Based Development (High-Velocity Teams)\n\nBest for teams with strong CI\u002FCD and feature flags.\n\n```\nmain (trunk)\n  │\n  ├── short-lived feature (1-2 days max)\n  ├── short-lived feature\n  └── short-lived feature\n```\n\n**Rules:**\n- Everyone commits to `main` or very short-lived branches\n- Feature flags hide incomplete work\n- CI must pass before merge\n- Deploy multiple times per day\n\n### GitFlow (Complex, Release-Cycle Driven)\n\nBest for scheduled releases and enterprise projects.\n\n```\nmain (production releases)\n  │\n  └── develop (integration branch)\n        │\n        ├── feature\u002Fuser-auth\n        ├── feature\u002Fpayment\n        │\n        ├── release\u002F1.0.0    → merge to main and develop\n        │\n        └── hotfix\u002Fcritical  → merge to main and develop\n```\n\n**Rules:**\n- `main` contains production-ready code only\n- `develop` is the integration branch\n- Feature branches from `develop`, merge back to `develop`\n- Release branches from `develop`, merge to `main` and `develop`\n- Hotfix branches from `main`, merge to both `main` and `develop`\n\n### When to Use Which\n\n| Strategy | Team Size | Release Cadence | Best For |\n|----------|-----------|-----------------|----------|\n| GitHub Flow | Any | Continuous | SaaS, web apps, startups |\n| Trunk-Based | 5+ experienced | Multiple\u002Fday | High-velocity teams, feature flags |\n| GitFlow | 10+ | Scheduled | Enterprise, regulated industries |\n\n## Commit Messages\n\n### Conventional Commits Format\n\n```\n\u003Ctype>(\u003Cscope>): \u003Csubject>\n\n[optional body]\n\n[optional footer(s)]\n```\n\n### Types\n\n| Type | Use For | Example |\n|------|---------|---------|\n| `feat` | New feature | `feat(auth): add OAuth2 login` |\n| `fix` | Bug fix | `fix(api): handle null response in user endpoint` |\n| `docs` | Documentation | `docs(readme): update installation instructions` |\n| `style` | Formatting, no code change | `style: fix indentation in login component` |\n| `refactor` | Code refactoring | `refactor(db): extract connection pool to module` |\n| `test` | Adding\u002Fupdating tests | `test(auth): add unit tests for token validation` |\n| `chore` | Maintenance tasks | `chore(deps): update dependencies` |\n| `perf` | Performance improvement | `perf(query): add index to users table` |\n| `ci` | CI\u002FCD changes | `ci: add PostgreSQL service to test workflow` |\n| `revert` | Revert previous commit | `revert: revert \"feat(auth): add OAuth2 login\"` |\n\n### Good vs Bad Examples\n\n```\n# BAD: Vague, no context\ngit commit -m \"fixed stuff\"\ngit commit -m \"updates\"\ngit commit -m \"WIP\"\n\n# GOOD: Clear, specific, explains why\ngit commit -m \"fix(api): retry requests on 503 Service Unavailable\n\nThe external API occasionally returns 503 errors during peak hours.\nAdded exponential backoff retry logic with max 3 attempts.\n\nCloses #123\"\n```\n\n### Commit Message Template\n\nCreate `.gitmessage` in repo root:\n\n```\n# \u003Ctype>(\u003Cscope>): \u003Csubject>\n# # Types: feat, fix, docs, style, refactor, test, chore, perf, ci, revert\n# Scope: api, ui, db, auth, etc.\n# Subject: imperative mood, no period, max 50 chars\n#\n# [optional body] - explain why, not what\n# [optional footer] - Breaking changes, closes #issue\n```\n\nEnable with: `git config commit.template .gitmessage`\n\n## Merge vs Rebase\n\n### Merge (Preserves History)\n\n```bash\n# Creates a merge commit\ngit checkout main\ngit merge feature\u002Fuser-auth\n\n# Result:\n# *   merge commit\n# |\\\n# | * feature commits\n# |\u002F\n# * main commits\n```\n\n**Use when:**\n- Merging feature branches into `main`\n- You want to preserve exact history\n- Multiple people worked on the branch\n- The branch has been pushed and others may have based work on it\n\n### Rebase (Linear History)\n\n```bash\n# Rewrites feature commits onto target branch\ngit checkout feature\u002Fuser-auth\ngit rebase main\n\n# Result:\n# * feature commits (rewritten)\n# * main commits\n```\n\n**Use when:**\n- Updating your local feature branch with latest `main`\n- You want a linear, clean history\n- The branch is local-only (not pushed)\n- You're the only one working on the branch\n\n### Rebase Workflow\n\n```bash\n# Update feature branch with latest main (before PR)\ngit checkout feature\u002Fuser-auth\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# Fix any conflicts\n# Tests should still pass\n\n# Force push (only if you're the only contributor)\ngit push --force-with-lease origin feature\u002Fuser-auth\n```\n\n### When NOT to Rebase\n\n```\n# NEVER rebase branches that:\n- Have been pushed to a shared repository\n- Other people have based work on\n- Are protected branches (main, develop)\n- Are already merged\n\n# Why: Rebase rewrites history, breaking others' work\n```\n\n## Pull Request Workflow\n\n### PR Title Format\n\n```\n\u003Ctype>(\u003Cscope>): \u003Cdescription>\n\nExamples:\nfeat(auth): add SSO support for enterprise users\nfix(api): resolve race condition in order processing\ndocs(api): add OpenAPI specification for v2 endpoints\n```\n\n### PR Description Template\n\n```markdown\n## What\n\nBrief description of what this PR does.\n\n## Why\n\nExplain the motivation and context.\n\n## How\n\nKey implementation details worth highlighting.\n\n## Testing\n\n- [ ] Unit tests added\u002Fupdated\n- [ ] Integration tests added\u002Fupdated\n- [ ] Manual testing performed\n\n## Screenshots (if applicable)\n\nBefore\u002Fafter screenshots for UI changes.\n\n## Checklist\n\n- [ ] Code follows project style guidelines\n- [ ] Self-review completed\n- [ ] Comments added for complex logic\n- [ ] Documentation updated\n- [ ] No new warnings introduced\n- [ ] Tests pass locally\n- [ ] Related issues linked\n\nCloses #123\n```\n\n### Code Review Checklist\n\n**For Reviewers:**\n\n- [ ] Does the code solve the stated problem?\n- [ ] Are there any edge cases not handled?\n- [ ] Is the code readable and maintainable?\n- [ ] Are there sufficient tests?\n- [ ] Are there security concerns?\n- [ ] Is the commit history clean (squashed if needed)?\n\n**For Authors:**\n\n- [ ] Self-review completed before requesting review\n- [ ] CI passes (tests, lint, typecheck)\n- [ ] PR size is reasonable (\u003C500 lines ideal)\n- [ ] Related to a single feature\u002Ffix\n- [ ] Description clearly explains the change\n\n## Conflict Resolution\n\n### Identify Conflicts\n\n```bash\n# Check for conflicts before merge\ngit checkout main\ngit merge feature\u002Fuser-auth --no-commit --no-ff\n\n# If conflicts, Git will show:\n# CONFLICT (content): Merge conflict in src\u002Fauth\u002Flogin.ts\n# Automatic merge failed; fix conflicts and then commit the result.\n```\n\n### Resolve Conflicts\n\n```bash\n# See conflicted files\ngit status\n\n# View conflict markers in file\n# \u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\n# content from main\n# =======\n# content from feature branch\n# >>>>>>> feature\u002Fuser-auth\n\n# Option 1: Manual resolution\n# Edit file, remove markers, keep correct content\n\n# Option 2: Use merge tool\ngit mergetool\n\n# Option 3: Accept one side\ngit checkout --ours src\u002Fauth\u002Flogin.ts    # Keep main version\ngit checkout --theirs src\u002Fauth\u002Flogin.ts  # Keep feature version\n\n# After resolving, stage and commit\ngit add src\u002Fauth\u002Flogin.ts\ngit commit\n```\n\n### Conflict Prevention Strategies\n\n```bash\n# 1. Keep feature branches small and short-lived\n# 2. Rebase frequently onto main\ngit checkout feature\u002Fuser-auth\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# 3. Communicate with team about touching shared files\n# 4. Use feature flags instead of long-lived branches\n# 5. Review and merge PRs promptly\n```\n\n## Branch Management\n\n### Naming Conventions\n\n```\n# Feature branches\nfeature\u002Fuser-authentication\nfeature\u002FJIRA-123-payment-integration\n\n# Bug fixes\nfix\u002Flogin-redirect-loop\nfix\u002F456-null-pointer-exception\n\n# Hotfixes (production issues)\nhotfix\u002Fcritical-security-patch\nhotfix\u002Fdatabase-connection-leak\n\n# Releases\nrelease\u002F1.2.0\nrelease\u002F2024-01-hotfix\n\n# Experiments\u002FPOCs\nexperiment\u002Fnew-caching-strategy\npoc\u002Fgraphql-migration\n```\n\n### Branch Cleanup\n\n```bash\n# Delete local branches that are merged\ngit branch --merged main | grep -v \"^\\*\\|main\" | xargs -n 1 git branch -d\n\n# Delete remote-tracking references for deleted remote branches\ngit fetch -p\n\n# Delete local branch\ngit branch -d feature\u002Fuser-auth  # Safe delete (only if merged)\ngit branch -D feature\u002Fuser-auth  # Force delete\n\n# Delete remote branch\ngit push origin --delete feature\u002Fuser-auth\n```\n\n### Stash Workflow\n\n```bash\n# Save work in progress\ngit stash push -m \"WIP: user authentication\"\n\n# List stashes\ngit stash list\n\n# Apply most recent stash\ngit stash pop\n\n# Apply specific stash\ngit stash apply stash@{2}\n\n# Drop stash\ngit stash drop stash@{0}\n```\n\n## Release Management\n\n### Semantic Versioning\n\n```\nMAJOR.MINOR.PATCH\n\nMAJOR: Breaking changes\nMINOR: New features, backward compatible\nPATCH: Bug fixes, backward compatible\n\nExamples:\n1.0.0 → 1.0.1 (patch: bug fix)\n1.0.1 → 1.1.0 (minor: new feature)\n1.1.0 → 2.0.0 (major: breaking change)\n```\n\n### Creating Releases\n\n```bash\n# Create annotated tag\ngit tag -a v1.2.0 -m \"Release v1.2.0\n\nFeatures:\n- Add user authentication\n- Implement password reset\n\nFixes:\n- Resolve login redirect issue\n\nBreaking Changes:\n- None\"\n\n# Push tag to remote\ngit push origin v1.2.0\n\n# List tags\ngit tag -l\n\n# Delete tag\ngit tag -d v1.2.0\ngit push origin --delete v1.2.0\n```\n\n### Changelog Generation\n\n```bash\n# Generate changelog from commits\ngit log v1.1.0..v1.2.0 --oneline --no-merges\n\n# Or use conventional-changelog\nnpx conventional-changelog -i CHANGELOG.md -s\n```\n\n## Git Configuration\n\n### Essential Configs\n\n```bash\n# User identity\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your@email.com\"\n\n# Default branch name\ngit config --global init.defaultBranch main\n\n# Pull behavior (rebase instead of merge)\ngit config --global pull.rebase true\n\n# Push behavior (push current branch only)\ngit config --global push.default current\n\n# Auto-correct typos\ngit config --global help.autocorrect 1\n\n# Better diff algorithm\ngit config --global diff.algorithm histogram\n\n# Color output\ngit config --global color.ui auto\n```\n\n### Useful Aliases\n\n```bash\n# Add to ~\u002F.gitconfig\n[alias]\n    co = checkout\n    br = branch\n    ci = commit\n    st = status\n    unstage = reset HEAD --\n    last = log -1 HEAD\n    visual = log --oneline --graph --all\n    amend = commit --amend --no-edit\n    wip = commit -m \"WIP\"\n    undo = reset --soft HEAD~1\n    contributors = shortlog -sn\n```\n\n### Gitignore Patterns\n\n```gitignore\n# Dependencies\nnode_modules\u002F\nvendor\u002F\n\n# Build outputs\ndist\u002F\nbuild\u002F\n*.o\n*.exe\n\n# Environment files\n.env\n.env.local\n.env.*.local\n\n# IDE\n.idea\u002F\n.vscode\u002F\n*.swp\n*.swo\n\n# OS files\n.DS_Store\nThumbs.db\n\n# Logs\n*.log\nlogs\u002F\n\n# Test coverage\ncoverage\u002F\n\n# Cache\n.cache\u002F\n*.tsbuildinfo\n```\n\n## Common Workflows\n\n### Starting a New Feature\n\n```bash\n# 1. Update main branch\ngit checkout main\ngit pull origin main\n\n# 2. Create feature branch\ngit checkout -b feature\u002Fuser-auth\n\n# 3. Make changes and commit\ngit add .\ngit commit -m \"feat(auth): implement OAuth2 login\"\n\n# 4. Push to remote\ngit push -u origin feature\u002Fuser-auth\n\n# 5. Create Pull Request on GitHub\u002FGitLab\n```\n\n### Updating a PR with New Changes\n\n```bash\n# 1. Make additional changes\ngit add .\ngit commit -m \"feat(auth): add error handling\"\n\n# 2. Push updates\ngit push origin feature\u002Fuser-auth\n```\n\n### Syncing Fork with Upstream\n\n```bash\n# 1. Add upstream remote (once)\ngit remote add upstream https:\u002F\u002Fgithub.com\u002Foriginal\u002Frepo.git\n\n# 2. Fetch upstream\ngit fetch upstream\n\n# 3. Merge upstream\u002Fmain into your main\ngit checkout main\ngit merge upstream\u002Fmain\n\n# 4. Push to your fork\ngit push origin main\n```\n\n### Undoing Mistakes\n\n```bash\n# Undo last commit (keep changes)\ngit reset --soft HEAD~1\n\n# Undo last commit (discard changes)\ngit reset --hard HEAD~1\n\n# Undo last commit pushed to remote\ngit revert HEAD\ngit push origin main\n\n# Undo specific file changes\ngit checkout HEAD -- path\u002Fto\u002Ffile\n\n# Fix last commit message\ngit commit --amend -m \"New message\"\n\n# Add forgotten file to last commit\ngit add forgotten-file\ngit commit --amend --no-edit\n```\n\n## Git Hooks\n\n### Pre-Commit Hook\n\n```bash\n#!\u002Fbin\u002Fbash\n# .git\u002Fhooks\u002Fpre-commit\n\n# Run linting\nnpm run lint || exit 1\n\n# Run tests\nnpm test || exit 1\n\n# Check for secrets\nif git diff --cached | grep -E '(password|api_key|secret)'; then\n    echo \"Possible secret detected. Commit aborted.\"\n    exit 1\nfi\n```\n\n### Pre-Push Hook\n\n```bash\n#!\u002Fbin\u002Fbash\n# .git\u002Fhooks\u002Fpre-push\n\n# Run full test suite\nnpm run test:all || exit 1\n\n# Check for console.log statements\nif git diff origin\u002Fmain | grep -E 'console\\.log'; then\n    echo \"Remove console.log statements before pushing.\"\n    exit 1\nfi\n```\n\n## Anti-Patterns\n\n```\n# BAD: Committing directly to main\ngit checkout main\ngit commit -m \"fix bug\"\n\n# GOOD: Use feature branches and PRs\n\n# BAD: Committing secrets\ngit add .env  # Contains API keys\n\n# GOOD: Add to .gitignore, use environment variables\n\n# BAD: Giant PRs (1000+ lines)\n# GOOD: Break into smaller, focused PRs\n\n# BAD: \"Update\" commit messages\ngit commit -m \"update\"\ngit commit -m \"fix\"\n\n# GOOD: Descriptive messages\ngit commit -m \"fix(auth): resolve redirect loop after login\"\n\n# BAD: Rewriting public history\ngit push --force origin main\n\n# GOOD: Use revert for public branches\ngit revert HEAD\n\n# BAD: Long-lived feature branches (weeks\u002Fmonths)\n# GOOD: Keep branches short (days), rebase frequently\n\n# BAD: Committing generated files\ngit add dist\u002F\ngit add node_modules\u002F\n\n# GOOD: Add to .gitignore\n```\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Create branch | `git checkout -b feature\u002Fname` |\n| Switch branch | `git checkout branch-name` |\n| Delete branch | `git branch -d branch-name` |\n| Merge branch | `git merge branch-name` |\n| Rebase branch | `git rebase main` |\n| View history | `git log --oneline --graph` |\n| View changes | `git diff` |\n| Stage changes | `git add .` or `git add -p` |\n| Commit | `git commit -m \"message\"` |\n| Push | `git push origin branch-name` |\n| Pull | `git pull origin branch-name` |\n| Stash | `git stash push -m \"message\"` |\n| Undo last commit | `git reset --soft HEAD~1` |\n| Revert commit | `git revert HEAD` |\n","# Git Workflow Patterns\n\nBest practices for Git version control, branching strategies, and collaborative development.\n\n## When to Activate\n\n- Setting up Git workflow for a new project\n- Deciding on branching strategy (GitFlow, trunk-based, GitHub flow)\n- Writing commit messages and PR descriptions\n- Resolving merge conflicts\n- Managing releases and version tags\n- Onboarding new team members to Git practices\n\n## Branching Strategies\n\n### GitHub Flow (Simple, Recommended for Most)\n\nBest for continuous deployment and small-to-medium teams.\n\n```\nmain (protected, always deployable)\n  │\n  ├── feature\u002Fuser-auth      → PR → merge to main\n  ├── feature\u002Fpayment-flow   → PR → merge to main\n  └── fix\u002Flogin-bug          → PR → merge to main\n```\n\n**Rules:**\n- `main` is always deployable\n- Create feature branches from `main`\n- Open Pull Request when ready for review\n- After approval and CI passes, merge to `main`\n- Deploy immediately after merge\n\n### Trunk-Based Development (High-Velocity Teams)\n\nBest for teams with strong CI\u002FCD and feature flags.\n\n```\nmain (trunk)\n  │\n  ├── short-lived feature (1-2 days max)\n  ├── short-lived feature\n  └── short-lived feature\n```\n\n**Rules:**\n- Everyone commits to `main` or very short-lived branches\n- Feature flags hide incomplete work\n- CI must pass before merge\n- Deploy multiple times per day\n\n### GitFlow (Complex, Release-Cycle Driven)\n\nBest for scheduled releases and enterprise projects.\n\n```\nmain (production releases)\n  │\n  └── develop (integration branch)\n        │\n        ├── feature\u002Fuser-auth\n        ├── feature\u002Fpayment\n        │\n        ├── release\u002F1.0.0    → merge to main and develop\n        │\n        └── hotfix\u002Fcritical  → merge to main and develop\n```\n\n**Rules:**\n- `main` contains production-ready code only\n- `develop` is the integration branch\n- Feature branches from `develop`, merge back to `develop`\n- Release branches from `develop`, merge to `main` and `develop`\n- Hotfix branches from `main`, merge to both `main` and `develop`\n\n### When to Use Which\n\n| Strategy | Team Size | Release Cadence | Best For |\n|----------|-----------|-----------------|----------|\n| GitHub Flow | Any | Continuous | SaaS, web apps, startups |\n| Trunk-Based | 5+ experienced | Multiple\u002Fday | High-velocity teams, feature flags |\n| GitFlow | 10+ | Scheduled | Enterprise, regulated industries |\n\n## Commit Messages\n\n### Conventional Commits Format\n\n```\n\u003Ctype>(\u003Cscope>): \u003Csubject>\n\n[optional body]\n\n[optional footer(s)]\n```\n\n### Types\n\n| Type | Use For | Example |\n|------|---------|---------|\n| `feat` | New feature | `feat(auth): add OAuth2 login` |\n| `fix` | Bug fix | `fix(api): handle null response in user endpoint` |\n| `docs` | Documentation | `docs(readme): update installation instructions` |\n| `style` | Formatting, no code change | `style: fix indentation in login component` |\n| `refactor` | Code refactoring | `refactor(db): extract connection pool to module` |\n| `test` | Adding\u002Fupdating tests | `test(auth): add unit tests for token validation` |\n| `chore` | Maintenance tasks | `chore(deps): update dependencies` |\n| `perf` | Performance improvement | `perf(query): add index to users table` |\n| `ci` | CI\u002FCD changes | `ci: add PostgreSQL service to test workflow` |\n| `revert` | Revert previous commit | `revert: revert \"feat(auth): add OAuth2 login\"` |\n\n### Good vs Bad Examples\n\n```\n# BAD: Vague, no context\ngit commit -m \"fixed stuff\"\ngit commit -m \"updates\"\ngit commit -m \"WIP\"\n\n# GOOD: Clear, specific, explains why\ngit commit -m \"fix(api): retry requests on 503 Service Unavailable\n\nThe external API occasionally returns 503 errors during peak hours.\nAdded exponential backoff retry logic with max 3 attempts.\n\nCloses #123\"\n```\n\n### Commit Message Template\n\nCreate `.gitmessage` in repo root:\n\n```\n# \u003Ctype>(\u003Cscope>): \u003Csubject>\n# # Types: feat, fix, docs, style, refactor, test, chore, perf, ci, revert\n# Scope: api, ui, db, auth, etc.\n# Subject: imperative mood, no period, max 50 chars\n#\n# [optional body] - explain why, not what\n# [optional footer] - Breaking changes, closes #issue\n```\n\nEnable with: `git config commit.template .gitmessage`\n\n## Merge vs Rebase\n\n### Merge (Preserves History)\n\n```bash\n# Creates a merge commit\ngit checkout main\ngit merge feature\u002Fuser-auth\n\n# Result:\n# *   merge commit\n# |\\\n# | * feature commits\n# |\u002F\n# * main commits\n```\n\n**Use when:**\n- Merging feature branches into `main`\n- You want to preserve exact history\n- Multiple people worked on the branch\n- The branch has been pushed and others may have based work on it\n\n### Rebase (Linear History)\n\n```bash\n# Rewrites feature commits onto target branch\ngit checkout feature\u002Fuser-auth\ngit rebase main\n\n# Result:\n# * feature commits (rewritten)\n# * main commits\n```\n\n**Use when:**\n- Updating your local feature branch with latest `main`\n- You want a linear, clean history\n- The branch is local-only (not pushed)\n- You're the only one working on the branch\n\n### Rebase Workflow\n\n```bash\n# Update feature branch with latest main (before PR)\ngit checkout feature\u002Fuser-auth\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# Fix any conflicts\n# Tests should still pass\n\n# Force push (only if you're the only contributor)\ngit push --force-with-lease origin feature\u002Fuser-auth\n```\n\n### When NOT to Rebase\n\n```\n# NEVER rebase branches that:\n- Have been pushed to a shared repository\n- Other people have based work on\n- Are protected branches (main, develop)\n- Are already merged\n\n# Why: Rebase rewrites history, breaking others' work\n```\n\n## Pull Request Workflow\n\n### PR Title Format\n\n```\n\u003Ctype>(\u003Cscope>): \u003Cdescription>\n\nExamples:\nfeat(auth): add SSO support for enterprise users\nfix(api): resolve race condition in order processing\ndocs(api): add OpenAPI specification for v2 endpoints\n```\n\n### PR Description Template\n\n```markdown\n## What\n\nBrief description of what this PR does.\n\n## Why\n\nExplain the motivation and context.\n\n## How\n\nKey implementation details worth highlighting.\n\n## Testing\n\n- [ ] Unit tests added\u002Fupdated\n- [ ] Integration tests added\u002Fupdated\n- [ ] Manual testing performed\n\n## Screenshots (if applicable)\n\nBefore\u002Fafter screenshots for UI changes.\n\n## Checklist\n\n- [ ] Code follows project style guidelines\n- [ ] Self-review completed\n- [ ] Comments added for complex logic\n- [ ] Documentation updated\n- [ ] No new warnings introduced\n- [ ] Tests pass locally\n- [ ] Related issues linked\n\nCloses #123\n```\n\n### Code Review Checklist\n\n**For Reviewers:**\n\n- [ ] Does the code solve the stated problem?\n- [ ] Are there any edge cases not handled?\n- [ ] Is the code readable and maintainable?\n- [ ] Are there sufficient tests?\n- [ ] Are there security concerns?\n- [ ] Is the commit history clean (squashed if needed)?\n\n**For Authors:**\n\n- [ ] Self-review completed before requesting review\n- [ ] CI passes (tests, lint, typecheck)\n- [ ] PR size is reasonable (\u003C500 lines ideal)\n- [ ] Related to a single feature\u002Ffix\n- [ ] Description clearly explains the change\n\n## Conflict Resolution\n\n### Identify Conflicts\n\n```bash\n# Check for conflicts before merge\ngit checkout main\ngit merge feature\u002Fuser-auth --no-commit --no-ff\n\n# If conflicts, Git will show:\n# CONFLICT (content): Merge conflict in src\u002Fauth\u002Flogin.ts\n# Automatic merge failed; fix conflicts and then commit the result.\n```\n\n### Resolve Conflicts\n\n```bash\n# See conflicted files\ngit status\n\n# View conflict markers in file\n# \u003C\u003C\u003C\u003C\u003C\u003C\u003C HEAD\n# content from main\n# =======\n# content from feature branch\n# >>>>>>> feature\u002Fuser-auth\n\n# Option 1: Manual resolution\n# Edit file, remove markers, keep correct content\n\n# Option 2: Use merge tool\ngit mergetool\n\n# Option 3: Accept one side\ngit checkout --ours src\u002Fauth\u002Flogin.ts    # Keep main version\ngit checkout --theirs src\u002Fauth\u002Flogin.ts  # Keep feature version\n\n# After resolving, stage and commit\ngit add src\u002Fauth\u002Flogin.ts\ngit commit\n```\n\n### Conflict Prevention Strategies\n\n```bash\n# 1. Keep feature branches small and short-lived\n# 2. Rebase frequently onto main\ngit checkout feature\u002Fuser-auth\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# 3. Communicate with team about touching shared files\n# 4. Use feature flags instead of long-lived branches\n# 5. Review and merge PRs promptly\n```\n\n## Branch Management\n\n### Naming Conventions\n\n```\n# Feature branches\nfeature\u002Fuser-authentication\nfeature\u002FJIRA-123-payment-integration\n\n# Bug fixes\nfix\u002Flogin-redirect-loop\nfix\u002F456-null-pointer-exception\n\n# Hotfixes (production issues)\nhotfix\u002Fcritical-security-patch\nhotfix\u002Fdatabase-connection-leak\n\n# Releases\nrelease\u002F1.2.0\nrelease\u002F2024-01-hotfix\n\n# Experiments\u002FPOCs\nexperiment\u002Fnew-caching-strategy\npoc\u002Fgraphql-migration\n```\n\n### Branch Cleanup\n\n```bash\n# Delete local branches that are merged\ngit branch --merged main | grep -v \"^\\*\\|main\" | xargs -n 1 git branch -d\n\n# Delete remote-tracking references for deleted remote branches\ngit fetch -p\n\n# Delete local branch\ngit branch -d feature\u002Fuser-auth  # Safe delete (only if merged)\ngit branch -D feature\u002Fuser-auth  # Force delete\n\n# Delete remote branch\ngit push origin --delete feature\u002Fuser-auth\n```\n\n### Stash Workflow\n\n```bash\n# Save work in progress\ngit stash push -m \"WIP: user authentication\"\n\n# List stashes\ngit stash list\n\n# Apply most recent stash\ngit stash pop\n\n# Apply specific stash\ngit stash apply stash@{2}\n\n# Drop stash\ngit stash drop stash@{0}\n```\n\n## Release Management\n\n### Semantic Versioning\n\n```\nMAJOR.MINOR.PATCH\n\nMAJOR: Breaking changes\nMINOR: New features, backward compatible\nPATCH: Bug fixes, backward compatible\n\nExamples:\n1.0.0 → 1.0.1 (patch: bug fix)\n1.0.1 → 1.1.0 (minor: new feature)\n1.1.0 → 2.0.0 (major: breaking change)\n```\n\n### Creating Releases\n\n```bash\n# Create annotated tag\ngit tag -a v1.2.0 -m \"Release v1.2.0\n\nFeatures:\n- Add user authentication\n- Implement password reset\n\nFixes:\n- Resolve login redirect issue\n\nBreaking Changes:\n- None\"\n\n# Push tag to remote\ngit push origin v1.2.0\n\n# List tags\ngit tag -l\n\n# Delete tag\ngit tag -d v1.2.0\ngit push origin --delete v1.2.0\n```\n\n### Changelog Generation\n\n```bash\n# Generate changelog from commits\ngit log v1.1.0..v1.2.0 --oneline --no-merges\n\n# Or use conventional-changelog\nnpx conventional-changelog -i CHANGELOG.md -s\n```\n\n## Git Configuration\n\n### Essential Configs\n\n```bash\n# User identity\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"your@email.com\"\n\n# Default branch name\ngit config --global init.defaultBranch main\n\n# Pull behavior (rebase instead of merge)\ngit config --global pull.rebase true\n\n# Push behavior (push current branch only)\ngit config --global push.default current\n\n# Auto-correct typos\ngit config --global help.autocorrect 1\n\n# Better diff algorithm\ngit config --global diff.algorithm histogram\n\n# Color output\ngit config --global color.ui auto\n```\n\n### Useful Aliases\n\n```bash\n# Add to ~\u002F.gitconfig\n[alias]\n    co = checkout\n    br = branch\n    ci = commit\n    st = status\n    unstage = reset HEAD --\n    last = log -1 HEAD\n    visual = log --oneline --graph --all\n    amend = commit --amend --no-edit\n    wip = commit -m \"WIP\"\n    undo = reset --soft HEAD~1\n    contributors = shortlog -sn\n```\n\n### Gitignore Patterns\n\n```gitignore\n# Dependencies\nnode_modules\u002F\nvendor\u002F\n\n# Build outputs\ndist\u002F\nbuild\u002F\n*.o\n*.exe\n\n# Environment files\n.env\n.env.local\n.env.*.local\n\n# IDE\n.idea\u002F\n.vscode\u002F\n*.swp\n*.swo\n\n# OS files\n.DS_Store\nThumbs.db\n\n# Logs\n*.log\nlogs\u002F\n\n# Test coverage\ncoverage\u002F\n\n# Cache\n.cache\u002F\n*.tsbuildinfo\n```\n\n## Common Workflows\n\n### Starting a New Feature\n\n```bash\n# 1. Update main branch\ngit checkout main\ngit pull origin main\n\n# 2. Create feature branch\ngit checkout -b feature\u002Fuser-auth\n\n# 3. Make changes and commit\ngit add .\ngit commit -m \"feat(auth): implement OAuth2 login\"\n\n# 4. Push to remote\ngit push -u origin feature\u002Fuser-auth\n\n# 5. Create Pull Request on GitHub\u002FGitLab\n```\n\n### Updating a PR with New Changes\n\n```bash\n# 1. Make additional changes\ngit add .\ngit commit -m \"feat(auth): add error handling\"\n\n# 2. Push updates\ngit push origin feature\u002Fuser-auth\n```\n\n### Syncing Fork with Upstream\n\n```bash\n# 1. Add upstream remote (once)\ngit remote add upstream https:\u002F\u002Fgithub.com\u002Foriginal\u002Frepo.git\n\n# 2. Fetch upstream\ngit fetch upstream\n\n# 3. Merge upstream\u002Fmain into your main\ngit checkout main\ngit merge upstream\u002Fmain\n\n# 4. Push to your fork\ngit push origin main\n```\n\n### Undoing Mistakes\n\n```bash\n# Undo last commit (keep changes)\ngit reset --soft HEAD~1\n\n# Undo last commit (discard changes)\ngit reset --hard HEAD~1\n\n# Undo last commit pushed to remote\ngit revert HEAD\ngit push origin main\n\n# Undo specific file changes\ngit checkout HEAD -- path\u002Fto\u002Ffile\n\n# Fix last commit message\ngit commit --amend -m \"New message\"\n\n# Add forgotten file to last commit\ngit add forgotten-file\ngit commit --amend --no-edit\n```\n\n## Git Hooks\n\n### Pre-Commit Hook\n\n```bash\n#!\u002Fbin\u002Fbash\n# .git\u002Fhooks\u002Fpre-commit\n\n# Run linting\nnpm run lint || exit 1\n\n# Run tests\nnpm test || exit 1\n\n# Check for secrets\nif git diff --cached | grep -E '(password|api_key|secret)'; then\n    echo \"Possible secret detected. Commit aborted.\"\n    exit 1\nfi\n```\n\n### Pre-Push Hook\n\n```bash\n#!\u002Fbin\u002Fbash\n# .git\u002Fhooks\u002Fpre-push\n\n# Run full test suite\nnpm run test:all || exit 1\n\n# Check for console.log statements\nif git diff origin\u002Fmain | grep -E 'console\\.log'; then\n    echo \"Remove console.log statements before pushing.\"\n    exit 1\nfi\n```\n\n## Anti-Patterns\n\n```\n# BAD: Committing directly to main\ngit checkout main\ngit commit -m \"fix bug\"\n\n# GOOD: Use feature branches and PRs\n\n# BAD: Committing secrets\ngit add .env  # Contains API keys\n\n# GOOD: Add to .gitignore, use environment variables\n\n# BAD: Giant PRs (1000+ lines)\n# GOOD: Break into smaller, focused PRs\n\n# BAD: \"Update\" commit messages\ngit commit -m \"update\"\ngit commit -m \"fix\"\n\n# GOOD: Descriptive messages\ngit commit -m \"fix(auth): resolve redirect loop after login\"\n\n# BAD: Rewriting public history\ngit push --force origin main\n\n# GOOD: Use revert for public branches\ngit revert HEAD\n\n# BAD: Long-lived feature branches (weeks\u002Fmonths)\n# GOOD: Keep branches short (days), rebase frequently\n\n# BAD: Committing generated files\ngit add dist\u002F\ngit add node_modules\u002F\n\n# GOOD: Add to .gitignore\n```\n\n## Quick Reference\n\n| Task | Command |\n|------|---------|\n| Create branch | `git checkout -b feature\u002Fname` |\n| Switch branch | `git checkout branch-name` |\n| Delete branch | `git branch -d branch-name` |\n| Merge branch | `git merge branch-name` |\n| Rebase branch | `git rebase main` |\n| View history | `git log --oneline --graph` |\n| View changes | `git diff` |\n| Stage changes | `git add .` or `git add -p` |\n| Commit | `git commit -m \"message\"` |\n| Push | `git push origin branch-name` |\n| Pull | `git pull origin branch-name` |\n| Stash | `git stash push -m \"message\"` |\n| Undo last commit | `git reset --soft HEAD~1` |\n| Revert commit | `git revert HEAD` |\n",{"name":5,"metadata":52,"description":7},{"origin":53},"ECC","main","74715deacdc69119d739f38916f8ee4f0f979ebf","skills\u002Fstorage\u002Faffaan-m_ECC\u002Fgit-workflow",0,"https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills","https:\u002F\u002Fgithub.com\u002Fmdnaimul22","AI Agents Workflows Automation | Specializing in Python, FastAPI, MCP Agents & Custom ERP.","2026-11-11 21:16:57",{"source":8,"skillName":5,"commands":63,"prompt":73,"zipAvailable":74},[64,67,70],{"tool":65,"command":66},"npx","npx skills add mdnaimul22\u002Fhuman-skills --skill git-workflow",{"tool":68,"command":69},"bunx","bunx skills add mdnaimul22\u002Fhuman-skills --skill git-workflow",{"tool":71,"command":72},"pnpm","pnpm dlx skills add mdnaimul22\u002Fhuman-skills --skill git-workflow","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Fgit-workflow\u002FSKILL.md",true,[],[77,85,111,132,151,166],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":84},"01M72JT3YP1SQHD0MANGDXQ4RT","higgsfield-websites","Build, edit, and deploy full-stack websites, apps and games via the Higgsfield CLI (`higgsfield website …`). Each is a React 19 + TanStack Start SSR app in one Cloudflare Worker (D1\u002FR2\u002FKV\u002FDO\u002FContainers). THREE product types, picked via `--type` on create: `website` (standalone, no Higgsfield integration — references\u002Fwebsite-flow.md), `app` (Sign in with Higgsfield + fnf SDK, Quanta — references\u002Fapp-flow.md), `game` (realtime multiplayer rooms — references\u002Fgame-flow.md). Routes to the right flow; each carries its own rules and deploy\u002Fpublish gates.\nUse when: \"build me a website\", \"make a landing page\", \"create a web app\", \"build a SaaS dashboard \u002F portfolio\", \"make me a game\", \"deploy this site\", \"publish\". Also owns GAME ART: \"make a spritesheet\", \"tileable texture\", \"animate a 3D character\", game music\u002FSFX — see the game-* references.\nNOT for: single image\u002Fvideo\u002Faudio generation (higgsfield-generate), product photos (higgsfield-product-photoshoot), marketplace cards (higgsfield-marketplace-cards).","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fhiggsfield-ai_skills\u002Fhiggsfield-websites\u002FSKILL.md",[],[],"2026-11-10 22:39:42",{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":103,"publishedAt":47},"01M70JPK8HAXXA85P7Q8NKZZYG","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fwriting-skills\u002FSKILL.md",[91,94,99,100],{"categoryNo":92,"categoryName":93,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},"01JBSEEDCAT000000000000036","内容创作者","PROFESSION","适用职业",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":101,"categoryName":102,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",[43,104,105,106,33,107,108,109,110],"writing skills","editing","deployment","Existing","new","when","work",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":122,"publishedAt":47},"01M70JP4PHBH1CQVVDWZ94W159","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fwriting-plans\u002FSKILL.md",[117,118,119],{"categoryNo":92,"categoryName":93,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":95,"categoryName":96,"taxonomyType":97,"taxonomyTypeDesc":98},{"categoryNo":120,"categoryName":121,"taxonomyType":97,"taxonomyTypeDesc":98},"01JBSEEDCAT000000000000030","开发工程师",[43,123,124,125,109,126,36,33,127,128,129,130,131],"writing plans","plans","you","code","requirements","task","multi","spec","multi-step task",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":47},"01M70JNTYVGXFZT8PASZ844TH8","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fverification-before-completion\u002FSKILL.md",[],[139,140,141,142,143,144,33,145,146,147,109,148,110,149,150],"verification","verification before completion","complete","about","output","assertions","prs","evidence","claim","claims","commands","running",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":158,"publishedAt":47},"01M70JNGVSQDESWN0Q5BPJ875V","using-superpowers","Use when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fusing-superpowers\u002FSKILL.md",[157],{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},[159,160,161,162,33,109,163,164,165],"using superpowers","superpowers","conversation","how to","how","find","questions",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":47},"01M70JN57CE588NPYPYTWH1DWG","using-git-worktrees","Use when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fobra_superpowers\u002Fusing-git-worktrees\u002FSKILL.md",[],[173,174,27,175,176,177,109,110,178,179,180,181,182,183,184,124,33,185,186],"using git worktrees","Using git","worktrees","git worktrees","implementation","git worktree","worktree","native","Tools","isolation","fallback","feature","via","workspace"]