I have been using git for years now and honestly, I really don't quite understand how certain codes work like for in this case git pull --rebase
. Can someone explain to me how rebase works like I'm five?
Thanks and you're awesome!
I have been using git for years now and honestly, I really don't quite understand how certain codes work like for in this case git pull --rebase
. Can someone explain to me how rebase works like I'm five?
Thanks and you're awesome!
For further actions, you may consider blocking this person and/or reporting abuse
Hanzla Baig -
JosĂ© Pablo RamĂrez Vargas -
Saad Shakil -
Jess Lee -
Top comments (4)
As a 5y old you started alone to build a Wood Wagon specifically for the mars Planet Atmosphere & gravity.
You put aside the wagon after you finish it, because your parents tels you we haven't colonize Mars yet.
After 35 yrs, the wagon is rotten, cannot be used, but you won a ticket to Mars and wait it so bad.
You find this Time Machine and hit the "rebase" button, while whispering "I wish I could bring my Mars Wood Wagon here & now". And Voila!
The Wagon is moved trough the history, and magically rebuilt in front of you. You get your wooden wagon here and now, you pack it and go on Mars with it. The Wagon building steps were erased from the history and you remember as you were building it today, not 35yrs ago.
Now ... I said alone, because if when you were 5y and built the Wagon, one of your friends have helped you, now ... when you moved it trough the history ... something really bad would happen. He will have memories of a thing that didn't existed.
Rebase, like a Time Machine is very powerful, should not be used lightly.
Disclaimer: I recommend NOT to use rebase for many reasons, try git merge --squash if you want this effect, but the history should remain as it was, not as we want, we should learn from history.
Wood Wagon - your commits on an old branch, put on hold while others developed the master. You want to bring the branch in a newer master.
5y Kid - you as developer
World - the repository
Time - commit order (A-B-C-D) in git history log
Friend - developer who helped you on that branch, and want to continue. You have to rebase --force your timeline into his, erase his memories too.
explained beautifully, thanks a lot!
Take a closer look at git rebase.
dev.to/theodesp/explain-git-rebase...