Resolving Conflicts with Master
Summary
git fetch origin # gets latest changes made to master
git checkout feature # switch to your feature branch
git merge master # merge with master
# resolve any merge conflicts here
git push origin feature # push branch and update the pull request
In Depth
The best way to resolve conflicts with master is to pull down the latest remote master
branch.
git switch master
git pull origin master
Then, merge the latest master
branch into your my-feature-branch
branch.
git switch my-feature-branch
git merge master
You should now be prompted with all the conflicts. There are a few ways to find and resolve the conflicts:
Using the VSC Source Control feature to help manage your conflicts.
Use the VSC Search feature. Go to the search feature and in the field place
<<<<<
It should find all the conflicts and report them to you.
In most cased you are accepting the incoming changes into your feature branch, however you may come across strange cases where you need to accept the current.
TIP
Pay close attention and read each conflict closely. If you are unsure ask a senior dev. This will benefit the whole team.
After resolving the conflicts, commit your changes.
git add .
git commit -m "merge master into my-feature-branch"
git push origin my-feature-branch
You should see that your conflicts have been resolved.