Tuesday, August 30, 2016

Git rebase without conflicts

If you worked on a branch and have difficulties to rebase it from another branch (like master), you can you use Git automatic conflicts resolution strategy which prioritize files in conflict from your branch or from the branch you need to rebase from.

So, let's go. Consider you're on your branch (git checkout my_branch). You have a local branch 'master' you want to rebase from because master is up-to-date and you want to retrieve last bug fxes and features from it.

If you want to prioritize your files in case of conflict, do :git rebase master -Xtheirs

If you want to prioritize files from 'master' branch in case of conflict, do :git rebase master -Xours