DEV Community

Discussion on: Explain Git Rebase just like I'm five

Collapse
 
leonpelech profile image
Leon Pelech • Edited

You're playing in the sand pit with a friend and decide to both build sandcastles. You build your sandcastle and have a flag which you put in the top. Your friend does the same and sticks a flag in hers. It's pretty cool!
You think that it would be even cooler if you could have your castle on top of hers but you can't lift yours up without it crumbling. Instead, you build an identical castle ontop of hers and put both your flags in the top.
Now you have a mega sand castle with your friends at the bottom and a copy of yours on top. Your original castle is still there but you won't build on it anymore.

Sand pit = repo
Flag = branch/HEAD
Castle = commits