Squashing git commits:
-
Create new branch from master (or branch from which you've branched)
-
git checkout ROOT_BRANCH (from which you've diverged with FEATURE_BRANCH)
-
git checkout -b HELPER_BRANCH
-
git merge FEATURE_BRANCH --squash
-
git checkout ROOT BRANCH
-
git branch -D FEATURE_BRANCH
-
git checkout -b FEATURE_BRANCH
-
git merge HELPER_BRANCH
-
git branch -D HELPER_BRANCH