While rebasing git rebase master
I notice there are conflicts. I don't care the changes that was made to master, I just want to put my current branch on top of master. How to force rebase so that your current branch is on top of master?
To rebase, make sure you have all the commits you want in the rebase in your master branch. Check out the branch you want to rebase and type git rebase master (where master is the branch you want to rebase on).
By default, the git pull command performs a merge, but you can force it to integrate the remote branch with a rebase by passing it the --rebase option.
I think this should do the trick:
git rebase -s recursive -X theirs master
It will rebase your current branch onto master
using the default recursive
strategy.
The -X theirs
switch applies the theirs
option to the strategy, which means if it hits a conflict, it will automatically overwrite 'our' changes with 'their' changes. In this rebase, 'our' changes are the ones on master
(the rebase 'root') and 'their' changes are those which are being rebased onto master (the ones from your current branch).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With