Skip to content
Discussion options

You must be logged in to vote

git merge creates a new commit that combines changes from two branches, preserving history exactly as it happened.

git rebase rewrites commit history by moving your commits to the tip of another branch, creating a linear history.

Best practices:

  • Use merge for public/shared branches
  • Use rebase for cleaning up local feature branches before merging
  • Never rebase commits that have been pushed to a shared repository

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by deathlegionteamlk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant