Git

Git hygiene

Before merging your branch (the one you are working on alone), do your own squash:

git reset HEAD~x --soft

(soft keeps the files in the index, so you do not need to select them)

Then rebase the branch onto main and push:

git rebase main
git push --force-with-lease

This is a better option than squash on merge, because if you want to return to the branch later, you still have consistency with the remote.

It gives you great order in the repository and history, but you have fewer commits and changed lines, which can be bad if you end up with a manager who does micromanagement and compares productivity based on the repo