What happens if I rebase after pushing?

前端 未结 2 1773
时光说笑
时光说笑 2021-01-17 08:34

I always hear that it\'s something scary and something I should never do. For example, here\'s how the pull dialog looks like in SourceTree:

So I\'m curious

2条回答
  •  既然无缘
    2021-01-17 08:58

    In the scenario you are listing in SourceTree, SourceTree rebases the local commits that haven't been pushed on top of the changes that you are pulling from the remote.

    If you had already pushed changes before using THAT option, those changes wouldn't be rebased because they're already in the remote.

    The only exception may be if you have multiple remotes, and have pushed changes to one remote, then do a pull/rebase from another - that could cause serious problems.

    Whether you should rebase or not during a pull is a subject of debate. I'm not recommending it, but it is generally safe. https://developer.atlassian.com/blog/2014/12/pull-request-merge-strategies-the-great-debate/

提交回复
热议问题