The following is an example workflow for developing on a temporary branch and merging back to the main branch squashing all commits into a single commit. This assumes you already have a branch named branch-xyz
and have finished the work on that branch.
git checkout branch-xyz