OkayTeacher
EN English 한국어 日本語 中文 हिन्दी বাংলা اردو Español Português Français Deutsch Русский العربية Bahasa Indonesia Tiếng Việt ไทย Türkçe

How to enable notifications

Notifications are unavailable in this browser or on this address. Try a supported browser on the secure SONUB site.

If notifications are blocked, allow them in your browser settings.

  1. Open the site controls beside the address bar, or your browser’s site settings. Set Notifications for this site to Allow.
  2. In your device settings, allow notifications for your browser and check Do Not Disturb or Focus.
  3. Return to SONUB, reload the page, and use the bell to enable notifications.

On iPhone or iPad, add SONUB to your Home Screen, open it there, then allow notifications.

All steps
Step 8

Reshaping history — rebase, stash, tag, cherry-pick

Techniques for editing history you already made. Powerful, and bound by one golden rule you must not break.

What you'll learn

  • You can tidy your own with an
  • You can shelve work in progress and come back to it
  • You can mark a release point with a and lift a single with

From here on you're editing history you already made. git rebase lifts your commits and replants them on top of another commit, straightening the history into one line. Where merge records what actually happened, rebase arranges it to be read. Add -i and you can squash commits together, reword messages, or reorder them before they go public.

A stack of colored blocks being lifted onto a taller stack, while a half-finished block rests in an open drawer at the side.
rebase re-stacks your commits on top of the newest main; stash keeps half-done work in a drawer.

There is exactly one golden rule: never rebase commits you have already shared. Rebase makes new commits and swaps them in. So if someone was building on the old ones, the history splits and is painful to put back together. Use it freely on your own until you open the , and not after.

git stash puts your unfinished work on a shelf — the command you reach for when an urgent lands and you must switch branches right now. git tag pins a name like v1.0.0 to a commit so you can find the exact you released. git cherry-pick lifts a single commit from another branch into this one. All three are tools for handling a part rather than the whole.

Understand it easily

stash is a drawer where you quickly put half-done work. rebase re-stacks your commits on top of the newest , as if you had started later. tag is a bookmark for a release, and cherry-pick copies just one commit to another branch.

Commands for this step

Don't just read them — type them into a real . Your hands have to remember, not your eyes.

git rebase -i HEAD~3
Interactively tidy your last three commits — squash, reword, reorder.
git stash push -m "작업 중"
Shelve your current changes with a note so you can switch branches now.
git tag -a v1.0.0 -m "첫 배포"
Mark this commit as a release point with an annotated tag.
git cherry-pick <commit>
Bring just one commit from another branch into this one.

Common mistake and how to fix it

Rebasing commits that are already and shared, then . Your teammates' history breaks. The golden rule: rebase only your own commits that nobody else has . To undo something already shared, use revert.

You mark this yourself. Nothing is graded here.

Mark this step as understood?

This cannot be undone yet, so mark it only when you really understand.

Marked as understood

You mark this yourself. Nothing is graded here.