git-workflow
Skill này làm gì
Skill này giải thích cách dùng Git trong một dự án nhóm, từ viết thông điệp commit rõ ràng đến quản lý nhánh. Skill dành cho lập trình viên muốn quản lý phiên bản nhất quán và dễ truy vết.
Khi nào nên dùng
- ✓Khi bạn sắp commit trong Git và muốn một thông điệp rõ ràng, chuẩn.
- ✓Khi bạn cần tạo, đặt tên hoặc quản lý nhánh cho một tính năng hoặc bản sửa.
- ✓Khi bạn đang xử lý quy trình pull request hoặc xung đột merge.
Liên kết skill
https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/git-workflow/SKILL.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Viết một thông điệp commit đúng chuẩn cho thay đổi của tôi, sửa lỗi làm mới captcha.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent làm theo quy tắc của dự án về loại commit, phạm vi và tiêu đề, và dùng cách đặt nhánh và merge rõ ràng để lịch sử dễ truy vết.
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 Standards
This document defines the project's Git usage standards, including commit message format, branch management strategy, workflows, merge strategies, and more. Following these standards improves collaboration efficiency, enables traceability, supports automation, and reduces conflicts.
Commit Message Standards
The project follows the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
Type Reference
| Type | Description | Example |
|---|---|---|
feat |
New feature | feat(user): add user export functionality |
fix |
Bug fix | fix(login): fix captcha not refreshing |
docs |
Documentation update | docs(api): update API documentation |
refactor |
Refactoring | refactor(utils): refactor utility functions |
perf |
Performance improvement | perf(list): optimize list performance |
test |
Test related | test(user): add unit tests |
chore |
Other changes | chore: update dependency versions |
Subject Rules
- Start with a verb: add, fix, update, remove, optimize
- No more than 50 characters
- No period at the end
For more detailed conventions and examples, see references/commit-conventions.md.
Branch Management Strategy
Branch Types
| Branch Type | Naming Convention | Description | Lifecycle |
|---|---|---|---|
| master | master |
Main branch, releasable state | Permanent |
| develop | develop |
Development branch, latest integrated code | Permanent |
| feature | feature/feature-name |
Feature branch | Delete after completion |
| bugfix | bugfix/issue-description |
Bug fix branch | Delete after fix |
| hotfix | hotfix/issue-description |
Emergency fix branch | Delete after fix |
| release | release/version-number |
Release branch | Delete after release |
Branch Naming Examples
feature/user-management # User management feature
feature/123-add-export # Issue-linked feature
bugfix/login-error # Login error fix
hotfix/security-vulnerability # Security vulnerability fix
release/v1.0.0 # Version release
Branch Protection Rules
master branch:
- No direct pushes allowed
- Must merge via Pull Request
- Must pass CI checks
- Requires at least one Code Review approval
develop branch:
- Direct pushes restricted
- Pull Request merges recommended
- Must pass CI checks
For detailed branch strategies and workflows, see references/branching-strategies.md.
Workflows
Daily Development Workflow
# 1. Sync latest code
git checkout develop
git pull origin develop
# 2. Create feature branch
git checkout -b feature/user-management
# 3. Develop and commit
git add .
git commit -m "feat(user): add user list page"
# 4. Push to remote
git push -u origin feature/user-management
# 5. Create Pull Request and request Code Review
# 6. Merge to develop (via PR)
# 7. Delete feature branch
git branch -d feature/user-management
git push origin -d feature/user-management
Hotfix Workflow
# 1. Create fix branch from master
git checkout master
git pull origin master
git checkout -b hotfix/critical-bug
# 2. Fix and commit
git add .
git commit -m "fix(auth): fix authentication bypass vulnerability"
# 3. Merge to master
git checkout master
git merge --no-ff hotfix/critical-bug
git tag -a v1.0.1 -m "hotfix: fix authentication bypass vulnerability"
git push origin master --tags
# 4. Sync to develop
git checkout develop
git merge --no-ff hotfix/critical-bug
git push origin develop
Release Workflow
# 1. Create release branch
git checkout develop
git checkout -b release/v1.0.0
# 2. Update version numbers and documentation
# 3. Commit version update
git add .
git commit -m "chore(release): prepare release v1.0.0"
# 4. Merge to master
git checkout master
git merge --no-ff release/v1.0.0
git tag -a v1.0.0 -m "release: v1.0.0 official release"
git push origin master --tags
# 5. Sync to develop
git checkout develop
git merge --no-ff release/v1.0.0
git push origin develop
Merge Strategy
Merge vs Rebase
| Feature | Merge | Rebase |
|---|---|---|
| History | Preserves complete history | Linear history |
| Use case | Public branches | Private branches |
| Recommended for | Merging to main branch | Syncing upstream code |
Recommendations
- Feature branch syncing develop: Use
rebase - Feature branch merging to develop: Use
merge --no-ff
Câu hỏi thường gặp
Conventional Commits là gì?
Đó là định dạng commit gồm một loại, một phạm vi tùy chọn và tiêu đề ngắn, như fix hoặc feat.
Quy tắc độ dài tiêu đề là gì?
Tiêu đề nên bắt đầu bằng một động từ, dưới 50 ký tự và không có dấu chấm ở cuối.
Skill có bao quát chiến lược merge không?
Có. Skill cũng bao quát các chiến lược phân nhánh và cách merge.
Chi tiết
Mô tả gốc của tác giả
This skill should be used when the user asks to "create git commit", "manage branches", "follow git workflow", "use Conventional Commits", "handle merge conflicts", or asks about git branching strategies, version control best practices, pull request workflows. Provides comprehensive Git workflow guidance for team collaboration.
Độ phổ biến
- Sao GitHub
- 6.0k
- Vị trí xếp hạng
- #14487
- Giấy phép
- MIT
- Cập nhật
- 19/10/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-identifier
6.0kDạy agent của bạn tạo agent Claude Code, viết đúng tên, mô tả kích hoạt, system prompt và cài đặt của chúng.
architecture-design
6.0kDạy agent của bạn bố cục code chuẩn cho dự án machine learning, dùng mẫu factory và registry khi thêm các thành phần có thể đăng ký.
bug-detective
6.0kGiúp agent của bạn tìm và sửa lỗi code bằng một phương pháp rõ ràng: hiểu vấn đề, thu thập bằng chứng, thử giả thuyết và xác minh bản sửa.
citation-verification
6.0kDạy agent của bạn kiểm tra từng trích dẫn trong một bài báo học thuật với các nguồn học thuật đáng tin cậy, phát hiện tài liệu tham khảo giả hoặc sai.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.