Git & Ship — Quản lý code và deploy

Quản lý git workflow, tạo worktree cho parallel development, và ship code lên production.

Cú pháp

/git                    # Git operations với conventional commits
/worktree               # Tạo isolated git worktree cho parallel dev
/ship                   # Ship pipeline: merge → test → review → push → PR

Bảng tham chiếu nhanh

LệnhMô tảUse case
/gitStaging, committing, pushing, PRs, mergesDaily git operations
/worktreeTạo git worktree riêng biệtParallel development trong monorepo
/shipFull ship pipeline (merge, test, review, push, PR)Ship feature lên production

/git — Git operations

Hỗ trợ conventional commits tự động:
/git                    # Auto-detect changes, suggest commit message
/git commit             # Stage + commit với conventional format
/git push               # Push + tạo PR nếu cần
Commit format tự động:
feat(auth): add Google OAuth login
fix(api): handle null response from payment gateway
chore(deps): upgrade Next.js to 14.2

/worktree — Parallel development

Tạo isolated copy của repo để làm việc trên nhiều branches cùng lúc:
1

Bước 1: Tạo worktree

Clone branch vào thư mục riêng, không ảnh hưởng main repo.
2

Bước 2: Làm việc

Code trong worktree — hoàn toàn isolated.
3

Bước 3: Merge/cleanup

Commit, push, tạo PR. Xóa worktree khi xong.

/ship — Ship pipeline

Full pipeline từ feature branch đến production:
1

Bước 1: Merge main

Pull latest từ main/staging, resolve conflicts nếu có.
2

Bước 2: Test

Chạy full test suite — phải PASS 100%.
3

Bước 3: Review diff

Review toàn bộ changes so với base branch.
4

Bước 4: Commit + Push

Commit final, push lên remote.
5

Bước 5: Create PR

Tạo PR với conventional title, description template.

Branch naming convention

feat/F01-01-generate-site          # Feature
fix/F01-builder-crash              # Bug fix
hotfix/F13-payment-timeout         # Urgent production fix
chore/deps-upgrade-nextjs          # Dependencies, config

Khi nào dùng / không dùng

DùngKhông dùng
Ship feature hoàn chỉnhChỉ commit nhỏ (dùng git CLI trực tiếp)
Parallel dev trên nhiều featuresSingle branch workflow
Cần conventional commits tự độngKhi muốn manual git control