Git Pull vs Git Rebase

Viewed 204473

I'm a noob in Git, and trying to learn the difference between git pull vs git rebase. Can someone provide an example when to use which option since I feel that both serve the same purpose.

3 Answers

In a nutshell :

Git Merge:

Merges your local changes and remote changes, and that will create another commit history record

Git Rebase:

Put your changes above all new remote changes, and rewrite commit history, so your commit history will be much cleaner than git merge. Rebase is a destructive operation. That means, if you do not apply it correctly, you could lose committed work and/or break the consistency of other developer's repositories.

Related