---
title: "Discussion on \"Git Merge vs Rebase vs Squash: Differences, History and When to Use Each (Tested Examples)\" | Hashnode"
description: "Discussion on \"Git Merge vs Rebase vs Squash: Differences, History and When to Use Each (Tested Examples)\". All three bring a branch's changes into another branch. The difference is what they leave in the history. git merge keeps every commit and adds a merge commit that joins the two lines. git rebase repl"
url: "https://hashnode.com/posts/git-merge-vs-rebase-vs-squash/6af1483db9009262824decd5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Git Merge vs Rebase vs Squash: Differences, History and When to Use Each (Tested Examples)](https://mfaysaldev.hashnode.dev/git-merge-vs-rebase-vs-squash?utm_source=hashnode&utm_medium=feed)

All three bring a branch's changes into another branch. The difference is what they leave in the history. git merge keeps every commit and adds a merge commit that joins the two lines. git rebase repl

1d ago · 14 min read · mfaysaldev.hashnode.dev  
Read the article

-   [#git](https://hashnode.com/tag/git)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Mahir Faysal](https://hashnode.com/@mfaysaldev)

@mfaysaldev

  
[View profile](https://hashnode.com/@mfaysaldev)

Student web developer — PHP, JavaScript, Next.js

I write practical coding tutorials at https://mfaysal.com | Learning cybersecurity on TryHackMe: https://tryhackme.com/p/mfaysal.dev

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
