Squashy squashy
I mentioned interactive rebase in my previous post to clean up messy git history but if you have a ton of commits (tsk tsk) and you don't want to go through them line by line (or use search and replace or a macro) there's an easier way to create a commit that has all the changes: git commit-tree
Specifically what we're going to do is create a new commit using whatever branch you're trying to merge or rebase into/onto as parent (in this case it's main) and tell git to just add all the changes that are in the current branch (your_feature_branch) into that commit.
$ git commit-tree -p main -m 'This is the squashed commit' your_feature_branch^{tree}
7935f2b24e66972315e46311c6401b255cbd46f0Quick note: if you're using zsh (or possibly other non-bash) shell you might have to single-quote 'your_feature_branch^{tree}'
The output of this command will be the commit hash of the new commit which you can reset your branch to - if you're skeptical you can create a backup with git switch -c backup and then go back to your branch
git reset --hard 7935f2b24e66972315e46311c6401b255cbd46f0Don't forget to push the changes (if you already pushed the tree you'll have to use --force) and have a great day knowing you spared yourself from a bit of tedium.