What is a Git merge?

Git merge integrates the changes from one branch into another by combining their histories, typically producing a new merge commit that has two parent commits.

Key Points

Example

Running git merge feature-branch while on main brings all the commits from feature-branch into main, creating a merge commit if the two branches have diverged.

git checkout main
git merge feature-branch

Interview Tip

A concise interview answer is

Git merge combines changes from one branch into another, creating a merge commit when histories have diverged, or simply fast-forwarding when they haven't. Unlike rebase, it never rewrites existing commits, which makes it safe to use on shared branches.

Last updated: 16 July 2026

Previous question: What is a Git branch?

Next question: What is a Git conflict?

More Git - Level I interview questions

All Git - Level I questions