Merge conflict after these steps:
- Feature branch created from develop branch.
- Commit A created on feature branch.
- Few commits merged to develop branch from other feature branches.
- Develop branch merged to feature branch - creating a merge commit.
- Until step 4, changes are made either in remote/local repository and pulled/pushed. Now, some more changes happened on remote develop branch which caused merge conflict (seen on web interface), for pull request from feature branch to develop branch.
Merge conflict resolution steps:
- Revert commit A in feature branch in local repository.
- Take latest changes from develop to local repository and merge to feature branch. This merge step doesn't cause any merge conflict as the changes on feature branch are reverted above step.
- Cherry pick the commit A onto feature branch, which presents merge conflict. Resolve the merge conflict. It is easy to resolve this merge conflict, as you'll be looking at the changes you intended to put in the feature branch.
Resolutions steps 1-3 are performed in local repository and pushed to remote.
Question: Merge conflict resolution steps work fine, if merge from develop to feature (merge commit - step 4) is not performed. Do these resolution steps present any issues, given after commit A, merge commits are performed on feature branch.
The query is not regarding how to resolve merge conflict. This is regarding the steps mentioned give any trouble, given after commit A, merge commit is also performed on feature branch.
Update - Answer: The above process works without any problem. In the question, after commit on feature branch(step 2), merge commit from develop branch to feature branch is done(step 4). The merge conflict resolution steps work fine, given, in the merge commit done on step 4, there are no merge conflicts resolved.
If there are merge conflicts resolved on step 4, changes meant for feature branch are in commit A as well as in merge commit(step 4). In this scenario, the merge conflict resolution steps(1-3) below are not sufficient. The merge resolution steps (1-3) should be followed from the beginning (from the time feature branch is created), if any merge conflict happen on the feature branch.