Git itu intimidating banget buat pemula. Tapi tenang, di tutorial ini aku bakal jelasin Git dari nol.

Git Itu Apa?

Git itu version control system. Bayangin punya “save point” di game, tapi untuk kode.

Install Git

Windows

Download dari git-scm.com

macOS

xcode-select --install

Linux

sudo apt install git

Basic Commands

git init                    # Buat repo baru
git add .                   # Add semua ke staging
git commit -m "msg"         # Commit
git status                  # Check status
git log                     # History
git branch                  # List branches
git checkout -b name        # New branch
git merge name              # Merge branch
git push                    # Push ke remote
git pull                    # Pull dari remote

Cheat Sheet

CommandFungsi
git initBuat repo baru
git add .Add semua ke staging
git commit -m "msg"Commit
git statusCheck status
git logHistory
git pushPush ke remote
git pullPull dari remote

Best Practices

  1. Atomic commits - Satu commit = satu fitur/fix
  2. Good commit messages - Jelas dan deskriptif
  3. Branch per fitur
  4. Pull before push
  5. .gitignore - Exclude file gak perlu

Conclusion

Dalam 30 menit, kamu udah belajar basic Git. Practice makes perfect!

Ada pertanyaan? Komen di bawah!