BM: Baca dalam Bahasa Melayu
World 11: Rescue Center
My push was rejected
You will learn: how to fix a rejected push without forcing it.
The problem
You type git push. GitHub says rejected. Did you break something? No! This happens to everyone. Here’s the safe way out.
Try it
What is GitHub telling you?
Pick one answer.
Watch
git fetch shows it: Aisyah pushed a commit. Your main and GitHub’s main went separate ways.
Try it
Put your commit on top of Aisyah’s. Then push again.
Hint
Typegit pull --rebase, then git push.Check
Good move after a rejected push, or needs work? Swipe each one.
Swipe right for good, left for needs work. Or use the buttons.
git pull --rebaseYou did it!
You can now fix a rejected push without forcing it.
Go deeper (optional)
Plain git pull may ask how to join the two lines. Pick --rebase or --no-rebase. Or set it once: git config --global pull.rebase true. Did the pull stop with a conflict? See “Messy pull: abort”. Never use --force on a shared branch.
Bahasa Melayu
Anda taip git push. GitHub kata rejected (ditolak). Anda rosakkan sesuatu? Tidak! Ini berlaku pada semua orang. Ini cara selamat untuk keluar.
Apa yang GitHub cuba beritahu?
git fetch tunjukkannya: Aisyah push satu commit (titik simpan). main anda dan main GitHub dah ikut jalan berasingan.
Letak commit anda di atas commit Aisyah. Kemudian push semula.
git pull --rebase, kemudian git push.Langkah bagus selepas push ditolak, atau perlu dibaiki? Leret setiap satu.
Kini anda boleh baiki push yang ditolak tanpa memaksa.
You finished this before. Practice is always welcome!
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?