Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #4742

git-workflow

Skill này làm gì

Giúp tổ chức cách các nhóm dùng Git, một hệ thống quản lý mã. Nó dạy các cách khác nhau để cấu trúc làm việc nhóm, cách tạo và gộp các phần mã (gọi là 'nhánh' và 'pull request'), và cách quản lý phiên bản dự án.

Khi nào nên dùng

  • ✓Khi bắt đầu một dự án mới với nhiều người.
  • ✓Khi nhóm gặp khó khăn trong việc quản lý thay đổi mã.
  • ✓Khi cần định nghĩa các quy tắc rõ ràng cho review và phê duyệt mã.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/git-workflow/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/git-workflow/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để tổ chức quy trình Git của chúng tôi để mọi người trong nhóm cộng tác tốt hơn?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Hướng dẫn này giải thích các phương pháp tổ chức công việc mã như 'Trunk-Based Development', 'GitHub Flow' và 'GitFlow'. Nó cũng chỉ cách viết thông điệp 'commit' (lưu mã) giải thích những gì đã thay đổi và vì sao, và cách thiết lập 'pull request' để review mã.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Git Workflow

Implement effective branching strategies and pull request workflows for team collaboration.

When to Use This Skill

Use this skill when:

  • Establishing team Git workflows
  • Implementing branching strategies
  • Configuring pull request processes
  • Setting up release management
  • Improving code review practices

Prerequisites

  • Git installed
  • Repository hosting (GitHub, GitLab, Bitbucket)
  • Basic Git knowledge

Branching Strategies

Trunk-Based Development

Best for: Continuous deployment, small teams, mature CI/CD

main ─────●─────●─────●─────●─────●─────●─────●
          │     │     │     │     │     │
          └─●   └─●   └─●   └─●   └─●   └─●
         feature branches (short-lived)
# Create short-lived feature branch
git checkout main
git pull origin main
git checkout -b feature/add-login

# Work and commit frequently
git add .
git commit -m "feat: add login form"

# Keep branch updated
git fetch origin
git rebase origin/main

# Merge quickly (same day ideally)
git checkout main
git pull origin main
git merge feature/add-login
git push origin main
git branch -d feature/add-login

GitHub Flow

Best for: Continuous delivery, web applications

main ─────●─────●───────────●─────────────●─────●
          │           ↑           ↑       ↑
          └───●───●───┘           │       │
              feature/login       │       │
                                  │       │
          └───●───●───●───●───────┘       │
              feature/dashboard           │
                                          │
          └───●─────────────────────────┘
              hotfix/security-patch
# Create feature branch from main
git checkout main
git pull origin main
git checkout -b feature/user-dashboard

# Push and create PR
git push -u origin feature/user-dashboard

# After review, merge via PR (squash recommended)
# Delete branch after merge

GitFlow

Best for: Scheduled releases, versioned products

main     ────────●────────────────●──────────────●
                 ↑                ↑              ↑
release  ────────┼────●───●──────┼──────────────┼
                 │    │   │      │              │
develop  ───●────●────┼───●──●───●───●───●───●──┼
            │         │      │       │   │      │
feature  ───┴─────────┘      │       │   │      │
                             │       │   │      │
hotfix   ────────────────────┴───────┼───┼──────┘
                                     │   │
feature  ────────────────────────────┴───┘
# Initialize GitFlow
git flow init

# Start feature
git flow feature start user-auth

# Finish feature (merges to develop)
git flow feature finish user-auth

# Start release
git flow release start 1.0.0

# Finish release (merges to main and develop)
git flow release finish 1.0.0

# Hotfix
git flow hotfix start security-fix
git flow hotfix finish security-fix

Commit Conventions

Conventional Commits

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

[optional body]

[optional footer(s)]

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation
  • style: Formatting
  • refactor: Code restructuring
  • test: Adding tests
  • chore: Maintenance

Examples:

git commit -m "feat(auth): add OAuth2 login support"
git commit -m "fix(api): handle null response from payment service"
git commit -m "docs: update API documentation for v2 endpoints"
git commit -m "refactor(db): optimize user query performance"

# Breaking change
git commit -m "feat(api)!: change response format for user endpoint

BREAKING CHANGE: The user endpoint now returns an object instead of array"

Commit Message Template

# Create template file ~/.gitmessage
# Subject line (50 chars max)

# Body (72 chars per line max)
# - What changed
# - Why it changed
# - Any side effects

# Footer
# Fixes #123
# Co-authored-by: Name <email>

# Configure Git to use template
git config --global commit.template ~/.gitmessage

Pull Request Workflow

PR Template

<!-- .github/pull_request_template.md -->
## Description
Brief description of changes

## Type of Change
- [ ] Bug fix (non-breaking change)
- [ ] New feature (non-breaking change)
- [ ] Breaking change
- [ ] Documentation update

## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed

## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review performed
- [ ] Documentation updated

…
Câu hỏi thường gặp

'Commit' là gì?

Đó giống như lưu lại một phiên bản công việc của bạn. Mỗi 'commit' có một thông điệp giải thích những gì đã thay đổi.

'Branch' là gì?

Nó giống như tạo một bản sao riêng của mã để làm tính năng mới hoặc sửa lỗi mà không ảnh hưởng đến phiên bản chính.

'Pull request' là gì?

Đây là yêu cầu gộp các thay đổi của bạn, thực hiện trên một 'nhánh', để nhóm review và gộp vào mã chính.

Chi tiết

Mô tả gốc của tác giả

Implement Git branching strategies, PR workflows, and release management patterns.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4742
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự