gitmergemerge-conflict-resolution

How to completely replace dev branch into master? (Without having to resolve conflicts)


My master branch is very out to date. Like 100+ commits behind dev, is not longer needed anymore. If I merge with dev there are many conflicts I don't need to resolve. Plus, I have created a master-old branch just in case. How can I make dev as my master without having to resolve conflicts.

I tried:

  1. Destoy master an create it again from dev (not allowed by github)
  2. Rebase (It need to resolve conflicts)
  3. Flag --theirs (not sure how to use it)

Solution

  • The easiest way:

    git checkout master
    git reset --hard dev
    git push --force