Langsung ke konten
Skillpedia
Pemrograman umum18k Β· #10679

git-expert

Fungsinya

Skill ini memandu pekerjaan git sehari-hari maupun yang lebih lanjut, termasuk strategi cabang, rebase, merge, penyelesaian konflik, dan pemulihan. Skill ini untuk pengembang yang memakai git dan ingin menghindari hilangnya pekerjaan.

Kapan dipakai

  • βœ“Saat Anda perlu menyelesaikan konflik merge atau rebase.
  • βœ“Saat Anda ingin menjaga riwayat tetap bersih dengan melakukan rebase pada cabang fitur.
  • βœ“Saat Anda membuat kesalahan di git dan perlu memulihkan commit yang hilang.

Link skill

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/git-expert/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/git-expert/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œRebase saya mengalami konflik di tiga berkas. Jelaskan langkah memperbaikinya dan tetap pertahankan perubahan saya.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini meminta agent memeriksa kondisi saat ini terlebih dahulu, membuat commit kecil yang fokus, dan memakai alat aman seperti reflog serta force-with-lease untuk pemulihan dan perubahan riwayat.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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 reflog as your safety net β€” almost nothing in Git is truly lost.

Branching Strategies

  • Trunk-based: short-lived feature branches, merge to main frequently. 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 rebase to keep a linear history on feature branches before merging.
  • Use git merge --no-ff when 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-lease to avoid overwriting others' work.

Conflict Resolution

  • Use git diff and git log --merge to understand the conflicting changes.
  • Resolve conflicts in an editor or merge tool, then git add the resolved files and git rebase --continue or git merge --continue.
  • If a rebase goes wrong, git rebase --abort returns to the pre-rebase state.
  • For complex conflicts, consider git rerere to 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 reflog and git 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 --force on shared branches β€” use --force-with-lease at minimum.
  • Do not commit large binary files β€” use Git LFS or .gitignore them.
  • Do not store secrets in Git history β€” if committed, rotate the secret immediately and use git filter-repo to purge.
  • Avoid very long-lived branches β€” they accumulate merge conflicts and diverge from main.
Pertanyaan umum

Apakah saya bisa kehilangan pekerjaan di git?

Skill ini menyatakan hampir tidak ada yang benar-benar hilang, karena git reflog dapat membantu menemukan commit sebelumnya.

Apa bedanya rebase dan merge?

Rebase menjaga riwayat tetap linear di cabang fitur, sedangkan merge mempertahankan struktur cabang di dalam riwayat.

Apakah saya harus force-push setelah rebase?

Skill ini menyarankan force-with-lease, dan tidak pernah menulis ulang cabang bersama seperti main tanpa persetujuan tim.

Detail

Deskripsi asli dari pembuat

Git operations expert for branching, rebasing, conflicts, and workflows

repo: RightNow-AI/openfang

Popularitas

Bintang GitHub
18k
Peringkat
#10679
Lisensi
Apache-2.0
Diperbarui
2/7/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa