How to prevent Gitlab from creating extra merge commit on branch merge

后端 未结 5 2204
庸人自扰
庸人自扰 2021-02-13 02:16

I use GitLab in my project. I\'m exploring Merge Requests feature.

  1. I created a topic_branch from master.
  2. Made a bunch of commit
5条回答
  •  耶瑟儿~
    2021-02-13 02:58

    I should have created a squash of commits on branch

    With GitLab 13.3 (August 2020), there is a new option which is interesting in your case:

    Squash Commits Options

    Squashing commits in Git is a great way to combine several commits into a single one.
    It’s great for grouping several commits, which by themselves may provide little historical value, into a single large commit before pushing upstream.
    Pushing a single commit allows for a more meaningful commit message, as well as ensuring the group of commits provides a “green” continuous integration pipeline.

    In GitLab 13.3 we are adding configurable defaults for squashing commits, allowing project maintainers to configure the option to suit their preferred workflow.

    Because changing squash configuration may introduce unwanted behavior, configuration has not been changed for new or existing projects. With 314 upvotes

提交回复
热议问题