here is how i do it. Then when I am ready to push to origin you can squash commits or whatever.
Switch to your clean branch that you keep synced to origin. Rebase it from orgin. Merge that into your feature branch.
<cope>
git checkout mycleanclone
git fetch
git pull --rebase
git checkout myfeature
git merge mycleanclone</code>
here is how i do it. Then when I am ready to push to origin you can squash commits or whatever.
Switch to your clean branch that you keep synced to origin. Rebase it from orgin. Merge that into your feature branch.
<cope>
git checkout mycleanclone
git fetch
git pull --rebase
git checkout myfeature
git merge mycleanclone</code>