Pengantar
Dari Hari 1 repo sudah ada. Hari ini: alur kerja harian + .gitignore.
Clone
Di folder induk proyek:
git clone git@github.com:USERNAME/latihan-github.git
cd latihan-github
ls
git remote -vEdit → commit → push
echo "Belajar GitHub" >> README.md
git add README.md
git commit -m "docs: update README"
git pushLihat di GitHub: commit baru muncul.
Pull sebelum push (kebiasaan baik)
git pull
git pushMengurangi risiko ditolak karena remote lebih maju.
.gitignore
File yang tidak boleh masuk repo:
- rahasia (
.env, kunci API) - dependensi (
node_modules/) - build (
dist/,.next/) - OS sampah (
.DS_Store)
Contoh .gitignore untuk proyek Node/Next sederhana:
node_modules/
.next/
dist/
.env
.env.*
!.env.example
.DS_Store
*.logtouch .gitignore
# edit isinya
git add .gitignore
git commit -m "chore: tambah gitignore"
git pushREADME yang membantu
README minimal:
- Nama proyek
- Cara menjalankan
- Stack singkat
GitHub merender README.md di beranda repo.
Kuis hari 2
File mana yang paling layak masuk .gitignore?
git clone berguna untuk?
Checklist
0/4 selesai