git merge tag to branch and squash commits

Shell
git checkout master
git merge --squash tag
git commit

Source

Also in Shell: