Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

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

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 commits on topic_branch.
  3. Pushed topic_branch to remote.
  4. Created a merge request on master to pull changes from topic_branch.
  5. On accept merge in Gitlab, master pulled all the commits and also created a merge commit which is horrible to see duplication of code.

I should have created a squash of commits on branch and then created merge request. But still master would have two new commits, one from the branch and another one would be merge commit. I'm assuming, if I do this from command line i.e,

  1. checkout master
  2. merge topic_branch into master
  3. commit / push master In this case, there would be only 1 commit on master.

How to achieve this from GitLab ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...