For squashing commits in git, the usual advice I see given is to use the rebase command. Also to use it interactively (-i) for more detailed options.
But, the pattern I've fallen into (just by playing around) is to use the reset command for squashing.
Usually I do:
git reset origin/<branch I'm working on>
Or, if I want to squash to any commit:
git reset <sha>
Then, after an add and commit, my local commits are squashed into one and I'm ready to push.
Am I following an anti-pattern? What kind of negative side-effects could I run into?