- We always merge to the current Head branch
- Steps to Fast Forward Merge:
- Switch to the branch that you need the feature branch to merge by using git switch
- Now use git merge “featurebranch” to merge the branch into Main branch.
- New commit on Master
- When there is new commit in the Master before the child branch git creates a new commit if there is no conflict(the changes are there in other file).
- Merge Conflict:
- Two people are working on the same file, and one person makes changes to lines that the other person also modified.
- One person is working on a feature branch, and another person makes changes to the same file(s) in the main branch.
- One person is trying to merge a feature branch into the main branch, but the feature branch contains changes that conflict with changes that were made to the main branch since the feature branch was created.
- Resolving Conflicts:
- Open the files with merge conflicts and edit the files to remove conflicts.
- Decide which branch content you want to keep in each conflict or keep the content from both.
- Remove the conflict markers in the document.
- Add your changes and then make a commit.