What is the difference between git merge and git rebase?

Git Medium

Git — Medium

What is the difference between git merge and git rebase?

Key points

  • Merge commits preserve branch history, while rebase creates a linear timeline.
  • Rebase replays commits, altering their order and history.
  • Merge operations retain original commit timestamps.
  • Rebase can simplify commit history, but may lose contextual information.
  • Both methods have use cases depending on project needs.

Ready to go further?

Related questions