Git Pull vs Git Rebase

后端 未结 3 1007
北荒
北荒 2021-01-29 20:31

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

3条回答
  •  粉色の甜心
    2021-01-29 20:58

    In a nutshell :

    -> Git Merge: It will simply merge your local changes and remote changes, and that will create another commit history record

    -> Git Rebase: It will 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.

提交回复
热议问题