Merge: Combining the changes from one branch into another, for example bringing a finished feature branch into the main branch.
Example
Your pull request is approved, so your mentor clicks Merge. Your commits from feature/search-filter become part of main, and the next deployment includes your feature.
How Merges Usually Happen in Teams
Most teams merge through a pull request on GitHub, GitLab, or Azure Repos, after reviews and automated checks. Locally, git merge branch-name combines another branch into the one you are on.
Merge Options You Will See
| Option | Result |
|---|---|
| Merge commit | Keeps all your commits and adds a merge commit |
| Squash and merge | Combines all your commits into one commit on main |
| Rebase and merge | Replays your commits on top of main for a straight history |
Teams choose one style. Follow whatever your repository's settings say.
Merge vs Rebase
Both bring changes together. Merge keeps history as it happened, with merge commits. Rebase rewrites your branch's commits to sit on top of the latest main, giving a cleaner line. A safe rule for interns: never rebase commits that others have already pulled. This is a common Git interview question.
When a Merge Fails
If both branches changed the same lines, Git stops with a merge conflict and asks you to decide the final code.
Related terms
- Merge Conflict: what happens when Git can't merge automatically.
- Pull Request (PR): the usual way merges happen in teams.
- Branch: what gets merged.
- Main Branch: the most common merge target.
Previous term: Meeting Etiquette | Next term: Merge Conflict
Related guides
- What to Do in Your First Week of an IT Internship
- Technical Interview Questions for Freshers
- DevOps Interview Questions Test
Frequently asked questions
What does merge mean in Git?
Merging combines the changes from one branch into another, such as a feature branch into main.
What is the difference between merge and rebase?
Merge combines branches and keeps history as it happened. Rebase moves your commits on top of another branch for a straight history.
What is squash and merge?
An option that combines all commits from a branch into a single commit when merging.
Who merges a pull request?
Depends on the team: sometimes the author after approval, sometimes a reviewer or lead.
Explore more internship terms
The IT Internship Glossary explains 199 terms you will hear before and during your internship, with simple definitions and real examples.
Browse all 199 terms