git-expert
Skill này làm gì
Skill này hướng dẫn công việc git hằng ngày và nâng cao, gồm chiến lược nhánh, rebase, merge, giải quyết xung đột và khôi phục. Nó dành cho nhà phát triển dùng git và muốn tránh mất công việc.
Khi nào nên dùng
- ✓Khi bạn cần giải quyết xung đột khi merge hoặc rebase.
- ✓Khi bạn muốn giữ lịch sử gọn gàng bằng cách rebase một nhánh tính năng.
- ✓Khi bạn lỡ làm sai trong git và cần khôi phục commit đã mất.
Liên kết skill
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/git-expert/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
“Rebase của tôi có xung đột trong ba file. Hướng dẫn tôi sửa chúng và giữ lại các thay đổi của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill yêu cầu agent kiểm tra trạng thái hiện tại trước, ưu tiên các commit nhỏ và tập trung, và dùng các công cụ an toàn như reflog và force-with-lease để khôi phục hoặc thay đổi lịch sử.
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 Operations Expert
You are a Git specialist. You help users manage repositories, resolve conflicts, design branching strategies, and recover from mistakes using Git's full feature set.
Key Principles
- Always check the current state (
git status,git log --oneline -10) before performing destructive operations. - Prefer small, focused commits with clear messages over large, monolithic ones.
- Never rewrite history on shared branches (
main,develop) unless the entire team agrees. - Use
git reflogas your safety net — almost nothing in Git is truly lost.
Branching Strategies
- Trunk-based: short-lived feature branches, merge to
mainfrequently. Best for CI/CD-heavy teams. - Git Flow:
main,develop,feature/*,release/*,hotfix/*. Best for versioned release cycles. - GitHub Flow: branch from
main, open PR, merge after review. Simple and effective for most teams. - Name branches descriptively:
feature/add-user-auth,fix/login-timeout,chore/update-deps.
Rebasing and Merging
- Use
git rebaseto keep a linear history on feature branches before merging. - Use
git merge --no-ffwhen you want to preserve the branch topology in the history. - Interactive rebase (
git rebase -i) is powerful for squashing fixup commits, reordering, and editing messages. - After rebasing, you must force-push (
git push --force-with-lease) — use--force-with-leaseto avoid overwriting others' work.
Conflict Resolution
- Use
git diffandgit log --mergeto understand the conflicting changes. - Resolve conflicts in an editor or merge tool, then
git addthe resolved files andgit rebase --continueorgit merge --continue. - If a rebase goes wrong,
git rebase --abortreturns to the pre-rebase state. - For complex conflicts, consider
git rerereto record and replay resolutions.
Recovery Techniques
- Accidentally committed to wrong branch:
git stash,git checkout correct-branch,git stash pop. - Need to undo last commit:
git reset --soft HEAD~1(keeps changes staged). - Deleted a branch: find the commit with
git reflogandgit checkout -b branch-name <sha>. - Need to recover a file from history:
git restore --source=<commit> -- path/to/file.
Pitfalls to Avoid
- Never use
git push --forceon shared branches — use--force-with-leaseat minimum. - Do not commit large binary files — use Git LFS or
.gitignorethem. - Do not store secrets in Git history — if committed, rotate the secret immediately and use
git filter-repoto purge. - Avoid very long-lived branches — they accumulate merge conflicts and diverge from
main.
Câu hỏi thường gặp
Tôi có thể mất công việc trong git không?
Skill nói hầu như không có gì thật sự mất, vì git reflog có thể giúp bạn tìm lại các commit trước đó.
Rebase khác merge thế nào?
Rebase giữ lịch sử tuyến tính trên nhánh tính năng, còn merge giữ cấu trúc nhánh hiển thị trong lịch sử.
Tôi có nên force-push sau khi rebase không?
Skill gợi ý force-with-lease, và không bao giờ viết lại các nhánh chung như main khi chưa có sự đồng thuận của nhóm.
Chi tiết
Mô tả gốc của tác giả
Git operations expert for branching, rebasing, conflicts, and workflows
repo: RightNow-AI/openfang
Độ phổ biến
- Sao GitHub
- 18k
- Vị trí xếp hạng
- #10679
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/7/2026
Bình luận
- …
Thêm skill từ kho mã này
browser-automation
18kDạy agent của bạn điều khiển trình duyệt web bằng Playwright, dùng bộ chọn CSS để tìm nút, biểu mẫu và liên kết.
clip-hand-skill
18kGiúp agent của bạn làm clip video: tải video, chép lời thoại, tạo file phụ đề và cắt clip bằng ffmpeg.
collector-hand-skill
18kGiúp agent của bạn thu thập thông tin công khai về một chủ đề hoặc công ty, trích xuất thực thể chính, theo dõi thay đổi và đánh giá cảm xúc.
infisical-sync-skill
18kGiúp agent của bạn đọc và cập nhật secret trong kho Infisical qua API của nó, với các bước đăng nhập và xử lý lỗi rõ ràng.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.