What happens if I rebase after pushing?

前端 未结 2 1758
时光说笑
时光说笑 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 09:13

    Nothing would happen, but your next push would be not accepted.

    Unless you would force push. This would not break remote repository also, so it is also not that bad.

    Things go bad when you have more people using this repo. Rewriting history can cause a bit of chaos for others who will pull new changes from remote. Especially if they do not have good knowledge of git. There can be different things that might happen for person pulling rewritten remote branch depending on state of their local repository.

    So if someone would work on feature X and you changed the code on which he based his changes, he might get at least upset to downright angry depending on how much of his work you made obsolete.

提交回复
热议问题