How to prevent Gitlab from creating additional merge commit when merging branches

I am using GitLab in my project. I am learning the Merge Requests function.

  • I created topic_branchfrom master.
  • Made a bunch of commits on topic_branch.
  • Clicking topic_branchon the remote.
  • Created a merge request on masterto extract changes from topic_branch.
  • When accepting a merge in Gitlab, masterpulled out all the commits, and also created a merge that is terrible to see code duplication.

I had to create squash commits on a branch and then create a merge request. But it masterwill still have two new commits, one from the branch, and the other a merge. I guess if I do this from the ie command line,

  • checkout master
  • merge topic_branchinmaster
  • commit / push master In this case, there masterwill be only 1 commit.

How to achieve this from GitLab?

+4
source share
4 answers

As I understood from http://doc.gitlab.com/ee/workflow/rebase_before_merge.html GitLab will always create a merge to save the way to return the whole branch.

0
source
  • checkout master
  • merge topic_branchinmaster
  • commit / push masterIn this case, there masterwill be only 1 commit.

. topic_branch Merge branch 'topic_branch' , , , topic_branch. git merge , . topic_branch es master (. ).

GitLab, , topic_branch . GitLab , , , .

: GitLab : . . , , GitLab Enterprise Edition.

0
TL; DR

> > > > .

squash commits .


, GitLab .

  • project
  • settings (: , )
  • General.
  • Merge Request Settings
  • Fast-Forward Merge.

enter image description here

0

, . , () .

-2

All Articles