I'm having a strange issue when trying to squash some remote commits. I made a series of small changes to a GitLab .yml file (22 to be exact) that I would like to squash into one commit.
What I have tried to do so far is to use the command 'git reset --soft HEAD~22', then committing the squashed commit as one commit, and then force pushing to squash the commit remotely (as is done in this answer). I know using a separate branch for this in the first place would have been wiser and much less painful by using the automatic squash in GitLab's merge requests, but I am relatively new to Git and have certainly learned my lesson.
What is happening is this. When I try to do all 22, it squashes the last 44, when I do 2 it squashes the last 24. I've tried a few other numbers and it seems random (11 nets me 33 squashed commits, 4 gives me 25, etc.). What is going on here? I haven't caused any damage to my remote repo because I have not pushed anything and I have made numerous local backups, but I am totally perplexed.