Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to rebase and squash commits on Gitlab CE UI?

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

like image 372
amigo21 Avatar asked Mar 16 '17 17:03

amigo21


1 Answers

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".

https://docs.gitlab.com/ee/user/project/merge_requests/img/squash_mr_widget.png

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)

https://about.gitlab.com/images/11_0/squash-and-merge-core.png

That will help keeping the Git history clean!


With GitLab 13.3 (August 2020), there is a new option which is interesting for squash commits:

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 👍, this is one of the most highly requested improvements by the community and we hope it allows more users to use this powerful feature.

https://about.gitlab.com/images/13_3/create_source_code_configurable_defaults_for_squash_commits_option.png -- Squash Commits Options

See Documentation and Issue.

like image 174
VonC Avatar answered Sep 22 '22 13:09

VonC