Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
I always wanted to know what rebase did. But I know I won’t google it anytime soon. Mind giving a quick summary of it? I’ll at least read your response!
aEEEdev9063yI hope i wont get crucified for getting it wrong.. But anyway.. assume a branch with commits A and B. At this point let us branch out to another branch . So now both branches have A and B.. Now you commit C and D in the 2nd branch..But in the meantime..Some over enthusiastic guy has commited 10 times on the main branch.. So to include those 10 commits in your branch you can use rebase.. rebase is basically what it means literally.. It changes the base of the branch from B to B+10 ..after which your commits C and D will appear..
aEEEdev9063yrebase also does many things in interactive mode.. It can also be used to copy any range of commits from a branch to another. in interactive mode , you can squash..fixup..edit commits..
That being said, rebase is a dangerous command in a shared repo as it destroys the original tree..