I'm wondering how people address one of the scenarios raised in the post, specifically this:<p>"It’s safest to keep private branches local. If you do need to push one, maybe to synchronize your work and home computers, tell your teammates that the branch you pushed is private so they don’t base work off of it.<p>You should never merge a private branch directly into a public branch with a vanilla merge. First, clean up your branch with tools like reset, rebase, squash merges, and commit amending."<p>I'm wonder how people address cleaning a private branch that has been pushed (when your goal is to get its changes into master cleanly). Rebasing the private branch is pretty much out of the picture since it has been pushed (unless you don't care about pushing it again). I can see some ways of doing this:<p>1) You could do a diff patch and apply it master, then commit.<p>2) You could checkout your private feature branch, do a git reset to master in such a way that your index is still from the private, then commit it. Ex:<p>currently on private branch
git reset --soft master<p>Now all the changes from the private branch are changes to be committed on master. This is easy, but it puts everything in one commit.<p>If you wanted to do a few commits for different, but stable points, but you already pushed the private branch and can't rebase it, you could instead do "git reset --soft" on successive points in the private branch commit chain, committing to master as you go.<p>If you wanted to reorder commits from the private branch, I guess you could rebase the private branch (which means you can't push again since you pushed it already), then do the tactic from the last paragraph, then ditch the private branch cause it's no longer pushable.<p>Does anyone have better ways of putting changes to master for private branches that have already been pushed?