When committing changes it is possible to specify that the commit will in future be squashed to another commit and this can be done like so,
git commit --squash=[commit hash of commit to which this commit will be squashed to]
One might also use, --fixup=[commit hash]
alternatively to fixup.
It is also possible to use words from the commit message instead of the commit hash, like so,
git commit --squash :/things
where the most recent commit with the word 'things' would be used.
These commits' message would begin with 'fixup!'
or 'squash!'
followed by the rest of the commit message to which these commits will be squashed to.
When rebasing --autosquash
flag should be used to use the autosquash/fixup feature.