BM: Baca dalam Bahasa Melayu
World 9: Power Tools · Boss challenge
Ship with gh and a Codespace
You will learn: to ship a real fix from a Codespace, using gh.
The problem
Tap each point on the timeline.
Boss time! Ship one tiny fix to your real repo. Your only tools: a Codespace and gh. Here is the route. Tap each stop.
Watch
Stop 1: open a Codespace on your diary repo. Run these two commands, or use the Code button on GitHub. Codespaces need a GitHub account and have usage limits.
Try it
Inside the Codespace, what comes next? Put the stops in order.
First step at the top. Put these in order. Use the arrows, or drag.
- Fix the typo in README.md
- Run gh pr create
- Commit the fix
- Push the branch
- Make a branch: git switch -c fix-typo
Hint
A pull request needs a pushed branch first.Try it
Build the command that opens the pull request. Let it reuse your commit message.
Tap the pieces in the right order.
Watch
Stops 4 and 5: push, then gh pr create. It prints a link to your new pull request. The default Codespace already has gh, signed in for this repo.
Predict
You used --fill. Where do the pull request’s title and body come from?
Pick one answer.
Try it
Now do it for real. Tick each step as you go.
Mission: ship it
gh repo create diary --public --add-readmegh codespace create --repo YOUR-NAME/diarygit switch -c fix-typogit commit -am "docs: fix typo in README"git push -u origin fix-typogh pr create --fillgh codespace stop
0 of 8 steps done · Your ticks are saved.
Hint
One step at a time. Tick each one when it is done.Check
Can GitHub see your work? Type your username and check.
Check it on GitHub
- Your diary repo is publicNot checked yet
- GitHub sees your pull request in diaryNot checked yet
You did it!
You can now ship a fix from a Codespace, using gh.
Go deeper (optional)
Happy with it? Merge from the terminal with gh pr merge. Once your work is pushed, gh codespace delete removes the Codespace. No Codespace? Press . on your repo for github.dev. Commit to a new branch there. Then open the pull request in the browser.
Bahasa Melayu
Masa boss! Hantar satu pembaikan kecil ke repo sebenar anda. Alatan anda hanya Codespace dan gh. Ini laluannya. Ketik setiap hentian.
Hentian 1: buka Codespace pada repo diary anda. Jalankan dua arahan ini, atau guna butang Code di GitHub. Codespace perlukan akaun GitHub dan ada had penggunaan.
Dalam Codespace, apa seterusnya? Susun hentian ikut urutan.
Bina arahan yang buka pull request. Biar ia guna semula mesej commit anda.
Hentian 4 dan 5: push, kemudian gh pr create. Ia cetak pautan ke pull request baru anda. Codespace lalai dah ada gh, siap log masuk untuk repo ini.
Anda guna --fill. Dari mana datangnya tajuk dan isi pull request itu?
Sekarang buat betul-betul. Tick setiap langkah semasa anda buat.
Boleh GitHub nampak kerja anda? Taip nama pengguna anda dan semak.
Kini anda boleh hantar pembaikan dari Codespace, dengan gh.
You finished this before. Practice is always welcome!
Official docs: Creating a codespace for a repository · gh codespace create · gh pr create · git switch
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?