In our development using GitLab we usually squash commits from feature branches when they are merged in main branch (we use rebase strategy instead of merge if it matters).
But if the commits from feature branch are squashed to a single commit (which is later merged in main branch) and the branch itself is deleted, how can GitLab still show the original commits? Are they kept in the repository forever or it is a matter of time when they finally get dropped?
I believe GitLab does some garbage collection on the repository, but I wonder why it does not affect commits from MR.
The squash and merge commit page does mention:
That merge commit might very well keep a reference to the branch before squashing, which can explain why the original commits are still visible.
If that is not the case, meaning nothing actually references those commits, then housekeeping (described here for self-managed GitLab, but also active on Cloud offering) will remove them the repository eventually.
However: