Use of git rebase in public feature branches

前端 未结 3 454
余生分开走
余生分开走 2021-01-30 11:31

You can see all over the web people advising to not use git rebase in a public branch, but I can\'t see what\'s the problem, if you always rebase a feature branch.<

3条回答
  •  既然无缘
    2021-01-30 11:47

    When you rebase against public branch, it's perfectly ok.

    But when you rebase public branch itself, it is not good for people which are also working with it.

    Addition:

    When rebase breaks unittest, you won't have an opportunity to git bisect the faulty revision.

    In more details:

    • you have prepared some code to be added to the branch.
    • you have debugged it so it passes all unit tests
    • you've git-fetched new changes in the (remote) branch
    • now you're rebasing your code against rebased remote branch
    • and here unittests get broken
    • you're running git bisect and it points at the remote rebase.
    • your actions?

提交回复
热议问题