Is there a way to rebase and squash commits on Git

2019-04-10 05:15发布

问题:

Is there a way to rebase and squash commits on Gitlab CE UI, instead of using the interactive mode through command-line?

回答1:

It seems implemented in issue EE 150 to the EE PR 1024, for allowing squashing merge request (GitLab EE 8.17).
See the documentation (EE for now) "Squash and merge".

The CE issue 4106 advocates for that feature to migrate back to CE.

Update Feb. 2018, a year later: as Jürgen Steinblock adds in the comments:

Great news!
It looks like this will make it into 10.8: see issue 34591: "Squash and merge in GitLab Libre (CE)".


Update June 2018: Jürgen Steinblock confirms in the comments:

GitLab 11 now includes Squash and merge for all editions, even Core (You have to manually enable a checkbox for existing merge requests and while creating new ones)

That will help keeping the Git history clean!



回答2:

Currently (as of version 11.4.4) it does not appear that GitLab (any edition) supports Squash when using Rebase. This might be due to the way Squash works as a part of the "interactive" feature of Rebase (see command "rebase -i").