I am wondering what are the best practices for resolving merge conflicts. in my particular case I want to basically overwrite the destination branch with the files of my development branch. However, I am not able to do so because of merge conflict. basically there was another commit on the destination branch and that file is different that the baseline used in my development branch. I understand the reason why the merge conflict is highlighted but in this particular case I just want to overwrite that file with the one from my development branch without having to do any local changes. is there any way to achieve this?
Some teams may have a policy in place where pushing code to important branches like `develop`, `release` or `master` are not permitted.
In this case you
git checkout feature/branch
git fetch origin develop
git merge FETCH_HEAD
And follow @Mikael Sandberg advice above. Most IDEs support resolving merge conflicts through their GUI where you can choose which code segment to accept.
Once you have resolved conflicts (and perhaps quickly built your code) run
git commit
which will conclude the merge.
Then push your feature branch to bitbucket (remote) and create a formal pull request from feature/branch to develop for your team to approve and merge, so all changes are consolidated in your target (develop) branch.
Let me know how you go, happy to help.
Best, Ulrich