Repository size increases a lot after git rebase
Summary
For a personal project, I did a couple of times a git rebase
(from root, usually, to change a typo in name, for example), and I noticed the repository which had these rebases force-pushed increased a lot in size, as if files were duplicated somewhere, hidden from me.
Steps to reproduce
Create repository with several files and several commits, make a reference copy, and rebase one from root a couple of times. At the end, the whole repository is identical to the reference one, but with really larger size. If you clone it locally to check the size, the difference is clearly visible.
Example Projects
If necessary, I can do it later, but I prefer in this case to wait because my test projects are not erased (related to this ticket).
What is the current bug behavior?
Force-pushed rebased repositories have bigger size than expected.
What is the expected correct behavior?
They must have the same size, rebased or not, if they contains the same files.
Possible fixes
Maybe I am wrong and some files are stored somewhere on purpose (how can I see them?), especially if these files are linked to erased commits (rebase changes easily the commit keys, and they are still in memory somewhere, because from old pipelines, I can still access to these no more existent commits with there related repository states). Maybe an option to hard-erase all these repository states (with files) associated to these commits belonging to pre-rebased repository state?