git-workflow-and-versioning
Fungsinya
Panduan ini mengajarkan Anda cara mengatur pekerjaan pemrograman menggunakan Git, sebuah sistem kontrol versi. Panduan ini membantu Anda menyimpan progres di 'titik simpan' (commit), bekerja di 'kotak pasir' terpisah (branch), dan menjaga riwayat yang jelas tentang apa saja yang sudah dikerjakan.
Kapan dipakai
- βSaat mulai mengerjakan fitur baru.
- βSaat membuat perubahan kecil pada kode.
- βSaat Anda perlu mengatur pekerjaan dari beberapa orang atau beberapa tugas sekaligus.
Link skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/git-workflow-and-versioning/SKILL.mdSalin 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
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBagaimana cara menyimpan progres kode saya agar bisa kembali jika terjadi kesalahan?β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Git memungkinkan Anda menyimpan pekerjaan secara bertahap (commit). Setiap commit seperti titik simpan. Jika Anda membuat kesalahan, Anda bisa dengan mudah kembali ke commit sebelumnya. Bekerja di 'branch' memungkinkan Anda membuat versi kode yang terpisah untuk bereksperimen atau mengerjakan fitur yang berbeda tanpa memengaruhi kode utama.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Git Workflow and Versioning
Overview
Git is your safety net. Treat commits as save points, branches as sandboxes, and history as documentation. With AI agents generating code at high speed, disciplined version control is the mechanism that keeps changes manageable, reviewable, and reversible.
When to Use
Always. Every code change flows through git.
Core Principles
Trunk-Based Development (Recommended)
Keep main always deployable. Work in short-lived feature branches that merge back within 1-3 days. Long-lived development branches are hidden costs β they diverge, create merge conflicts, and delay integration. DORA research consistently shows trunk-based development correlates with high-performing engineering teams.
main βββββββββββββββββββββββββββββ (always deployable)
β² β± β² β±
ββββββ± ββββ± β short-lived feature branches (1-3 days)
This is the recommended default. Teams using gitflow or long-lived branches can adapt the principles (atomic commits, small changes, descriptive messages) to their branching model β the commit discipline matters more than the specific branching strategy.
- Dev branches are costs. Every day a branch lives, it accumulates merge risk.
- Release branches are acceptable. When you need to stabilize a release while main moves forward.
- Feature flags > long branches. Prefer deploying incomplete work behind flags rather than keeping it on a branch for weeks.
1. Commit Early, Commit Often
Each successful increment gets its own commit. Don't accumulate large uncommitted changes.
Work pattern:
Implement slice β Test β Verify β Commit β Next slice
Not this:
Implement everything β Hope it works β Giant commit
Commits are save points. If the next change breaks something, you can revert to the last known-good state instantly.
2. Atomic Commits
Each commit does one logical thing:
# Good: Each commit is self-contained
git log --oneline
a1b2c3d Add task creation endpoint with validation
d4e5f6g Add task creation form component
h7i8j9k Connect form to API and add loading state
m1n2o3p Add task creation tests (unit + integration)
# Bad: Everything mixed together
git log --oneline
x1y2z3a Add task feature, fix sidebar, update deps, refactor utils
3. Descriptive Messages
Commit messages explain the why, not just the what:
# Good: Explains intent
feat: add email validation to registration endpoint
Prevents invalid email formats from reaching the database.
Uses Zod schema validation at the route handler level,
consistent with existing validation patterns in auth.ts.
# Bad: Describes what's obvious from the diff
update auth.ts
Format:
<type>: <short description>
<optional body explaining why, not what>
Types:
featβ New featurefixβ Bug fixrefactorβ Code change that neither fixes a bug nor adds a featuretestβ Adding or updating testsdocsβ Documentation onlychoreβ Tooling, dependencies, config
4. Keep Concerns Separate
Don't combine formatting changes with behavior changes. Don't combine refactors with features. Each type of change should be a separate commit β and ideally a separate PR:
# Good: Separate concerns
git commit -m "refactor: extract validation logic to shared utility"
git commit -m "feat: add phone number validation to registration"
# Bad: Mixed concerns
git commit -m "refactor validation and add phone number field"
Separate refactoring from feature work. A refactoring change and a feature change are two different changes β submit them separately. This makes each change easier to review, revert, and understand in history. Small cleanups (renaming a variable) can be included in a feature commit at reviewer discretion.
5. Size Your Changes
Target ~100 lines per commit/PR. Changes over ~1000 lines should be split. See the splitting strategies in code-review-and-quality for how to break down large changes.
~100 lines β Easy to review, easy to revert
~300 lines β Acceptable for a single logical change
~1000 lines β Split into smaller changes
Branching Strategy
Feature Branches
main (always deployable)
β
βββ feature/task-creation β One feature per branch
βββ feature/user-settings β Parallel work
βββ fix/duplicate-tasks β Bug fixes
- Branch from
main(or the team's default branch)
β¦
Pertanyaan umum
Apa itu 'commit'?
Commit adalah 'titik simpan' untuk kode Anda. Commit mencatat perubahan yang Anda buat pada waktu tertentu. Anggap saja seperti menyimpan permainan Anda.
Apa itu 'branch'?
Branch seperti salinan terpisah dari kode Anda, tempat Anda bisa mengerjakan fitur baru atau memperbaiki bug tanpa memengaruhi versi utama. Setelah itu, perubahan tersebut bisa digabungkan kembali.
Mengapa saya sebaiknya membuat commit kecil dan sering?
Commit kecil dan sering memudahkan Anda melacak apa yang berubah, memahami riwayatnya, dan kembali ke versi sebelumnya jika terjadi masalah. Ini seperti menyimpan permainan sering-sering, bukan hanya di akhir.
Detail
Deskripsi asli dari pembuat
Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.
Popularitas
- Bintang GitHub
- 48k
- Peringkat
- #4741
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
00-andruia-consultant
48kMembantu agent Anda memulai atau meningkatkan proyek AI. Agent menganalisis kode, menyarankan tools, dan membuat rencana aksi dalam bahasa Spanyol.
007
48kMemungkinkan agent Anda melakukan audit keamanan dan threat modeling. Berguna untuk melindungi proyek dari serangan dan celah keamanan.
10-andruia-skill-smith
48kMembantu agent Anda membuat atau meningkatkan tools AI. Agent mendefinisikan cara kerja tools, menulis dokumentasi, dan memvalidasi strukturnya.
20-andruia-niche-intelligence
48kMemungkinkan agent Anda membuat ringkasan industri tertentu. Berguna untuk memahami konteks, aturan, pola penggunaan, dan risiko proyek dengan sumber terpercaya.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.