Of the few times I have squashed Git commits, it took some manual work to pick the previous commits I wanted to squash.
Is there some way to so this automatically - my goal is to squash all previous commits that have not already been pushed to a particular remote branch.
To elaborate, say I have 1 local branch called "dev" and 2 remotes, public and private. I commit and push all I want to the private remote, to a branch called "dev", let's call that private/dev
. But on the public remote I want to keep things clean and tidy, and to keep one standard branch called "master", let's call that public/master
. So like I said, for all the commits that have not already made it to the public remote master branch, I want to squash those into one big commit, and the push to public/master
How can I achieve that? Seems complicated.