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.
operator fusion does at the compiler level: merges adjacent ops to reduce memory traffic
Compiler optimizations merge adjacent operations to reduce memory traffic
BPE tokenization does: iteratively merges the most frequent adjacent byte pairs
BPE tokenization merges frequent adjacent byte pairs iteratively
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 byte pairs
BPE tokenizes text by merging frequent byte pairs
consistent hashing solves: minimizes key redistribution when servers are added/removed
Consistent hashing minimizes key redistribution when servers are added/removed
merge sort: O(n log n) always
Ever wondered why sorting your music library takes ages?
Swipe through 100 ML concepts daily
Open Pocket Polymath