Git workflow and rebase vs merge questions

后端 未结 11 2235
春和景丽
春和景丽 2020-11-22 03:09

I\'ve been using Git now for a couple of months on a project with one other developer. I have several years of experience with SVN, so I guess I bring a lot of baggage to th

11条回答
  •  忘了有多久
    2020-11-22 04:04

    In your situation I think your partner is correct. What's nice about rebasing is that to the outsider your changes look like they all happened in a clean sequence all by themselves. This means

    • your changes are very easy to review
    • you can continue to make nice, small commits and yet you can make sets of those commits public (by merging into master) all at once
    • when you look at the public master branch you'll see different series of commits for different features by different developers but they won't all be intermixed

    You can still continue to push your private development branch to the remote repository for the sake of backup but others should not treat that as a "public" branch since you'll be rebasing. BTW, an easy command for doing this is git push --mirror origin .

    The article Packaging software using Git does a fairly nice job explaining the trade offs in merging versus rebasing. It's a little different context but the principals are the same -- it basically comes down to whether your branches are public or private and how you plan to integrate them into the mainline.

提交回复
热议问题