Ever wondered how to clean up messy code history?
Image: Carol M. Highsmith, Public domain, via Wikimedia Commons
Ever wondered how to clean up messy code history?
Imagine you're tidying up your messy room after a big party, with clothes and toys scattered everywhere. You want to put everything back in order without losing any items.
Think of Git merge as putting all toys back into their boxes, keeping all toys and clothes as they were. Rebase is like straightening clothes on the floor before putting them back in boxes, making everything look tidy but changing the order.
Example
You have a toy box (merge) with toys from last year (old commits) and this year (new commits) together. If you rebase, you first put this year's toys (new commits) on the floor (linearize history) before putting them back into the toy box (rebase commits).
Remember this
Merge keeps history intact, rebase creates a cleaner, linear history.
Text adapted from Wikipedia, licensed under CC BY-SA 4.0.
BPE tokenization does: iteratively merges the most frequent byte pairs
How can we shrink text files without losing meaning?
consistent hashing does: minimizes remapping when nodes join/leave
How can we efficiently share resources without constant reorganization?
BPE tokenization does: iteratively merges the most frequent adjacent byte pairs
How do we make computers understand language better?
consistent hashing solves: minimizes key redistribution when servers are added/removed
Ever wonder why adding or removing servers doesn't mess up your favorite streaming service?
merge sort: O(n log n) always
Ever wondered why sorting your music library takes ages?
operator fusion does at the compiler level: merges adjacent ops to reduce memory traffic
Did you know your computer can write faster code than you?
Swipe through 100 ML concepts daily
Open Pocket Polymath