I've been working in a branch, say master
. Changes are already pushed to remote repository. My history looks like this:
*----*----*----* master
Then I realize that I may have done something wrong and want to start from a different approach. I do this by creating a new branch:
*----*----*----* master
\
*----*----* different-approach
After some new commits, I decide that the new approach works better than the one in the master branch, so I want to use that from now on on the master
branch. So I do a merge:
git checkout master
git merge different-approach
In case there is any conflict, I always choose the version from the different-approach
merge. The problem is that for some files there is no conflict, so git does an automatic merge leaving in the bad stuff from the master
branch.
What can I do in this case? There seems to be no way to force a manual merge for all files in git. Of course I can clone the repository to a different directory and copy all files from it to the original directory before committing the merge. But isn't there a cleaner and simpler way to do this?