I have a master branch and development branch in Git. I don't want any merge complications -- I know that the master branch should be exactly identical to the development branch.
How can I forcefully replace the master branch with the contents of the development branch, without any merge prompts and without any merge effort?
This is one idea I have, but I would like to know if it's the best solution before attempting it:
git checkout master
git merge -X theirs dev_branch
git push origin master
One requirement is that it keeps the history of the master branch so I can always go back to a previous commit of the master branch if needed.