BM: Baca dalam Bahasa Melayu
World 10: Deep Git
rerere and range-diff
You will learn: how Git can remember conflict fixes, and how to compare two versions of a branch.
The problem
You rebase a long branch every week. The same conflict comes back every time. Must you fix it by hand again and again?
Pick one answer.
Watch
rerere: "Reuse recorded resolution": Git remembers how you fixed a conflict and does it again next time. means “reuse recorded resolution”. Git remembers how you fixed a conflict. Tap to see what happens next time.
Tap each point on the timeline.
Try it
Turn rerere on for all your projects. One setting is enough.
Hint
Typegit config --global rerere.enabled true.Predict
rerere fixed a conflict for you during a rebase. What should you still do?
Pick one answer.
Watch
After a rebase, did any commit change? range-diff: Compares two versions of a branch, commit by commit. compares two versions of a branch, commit by commit. feature@{1} is the branch before the rebase.
Check
range-diff marks each pair of commits. = means “the same”. What does ! mean?
Pick one answer.
Check
rerere or range-diff? Which helps here?
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now reuse conflict fixes and compare versions of a branch.
Go deeper (optional)
Recorded fixes live in .git/rr-cache. git rerere forget index.html drops a bad one. Set rerere.autoUpdate to true to add replayed fixes for you. git range-diff main...feature compares two branches that share a base. The practice terminal only explains these commands.
Bahasa Melayu
Anda rebase branch (cabang) yang panjang setiap minggu. Konflik yang sama muncul setiap kali. Perlukah anda baiki dengan tangan berulang kali?
rerere maksudnya “reuse recorded resolution” (guna semula pembaikan yang dirakam). Git ingat cara anda baiki konflik. Ketik untuk tengok apa berlaku lain kali.
Hidupkan rerere untuk semua projek anda. Satu tetapan sudah cukup.
git config --global rerere.enabled true.rerere baiki satu konflik untuk anda semasa rebase. Apa yang anda masih perlu buat?
Selepas rebase, ada commit yang berubah? range-diff banding dua versi branch, satu commit demi satu commit. feature@{1} ialah branch itu sebelum rebase.
range-diff tandakan setiap pasangan commit. = maksudnya “sama”. Apa maksud !?
rerere atau range-diff? Yang mana membantu di sini?
Kini anda boleh guna semula pembaikan konflik dan banding versi sesuatu branch.
You finished this before. Practice is always welcome!
Official docs: git rerere · git range-diff
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?