Git & GitHub Interview Question #38
What is a merge in Git?
Remotes, Fetch, Pull, Push, Merge, Conflicts, Rebase & Stash Junior Beginner
Quick Interview Answer
A merge combines development histories. Git finds the relevant common history and incorporates changes from another branch into the current branch.
Detailed Explanation
A merge combines development histories. Git finds the relevant common history and incorporates changes from another branch into the current branch.
Depending on the commit graph, the result may be a fast-forward or a merge commit. If incompatible edits affect the same content, Git may stop and require conflict resolution.
Code Example
git switch main
git merge feature/interview-search