Squashing (already pushed) commits on GitLab

I have a merge request with 5 commits, all pushed to the branch on GitLab. I'd like to squash those 5 commits into 1 -- but there are intermediate commits to the repo by other people. E.g.,in git log, you might see

my5thcommitsha
my4thcommitsha
someoneelse'scommitsha
someoneelse'scommitsha
my3rdcommitsha
my2ndcommitsha
my1stcommitsha

I've already rebased my branch to the latest commit on the repo master branch I'm trying to merge into.

Now, I just want to squash my five commits so it's cleaner on GitLab -- how could I do this?

Does the "squash commits" checkbox next to the merge button create a single commit, or will there be two (1 commit containing my 5 commits, + a merge commit)?



Read more here: https://stackoverflow.com/questions/66272227/squashing-already-pushed-commits-on-gitlab

Content Attribution

This content was originally published by user319407 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: