Git rebase a pushed feature branch
<p>I have a long running local feature branch which I was periodically squashing and rebasing with master to keep it up to date locally.</p>

<p>When completed I want my feature in a single squashed commit on top of master.</p>

<p>However, I was worried about losing my work in case of hardware issues, so I pushed this to a new feature branch on github as a precaution. Since doing this I'm not really sure how to keep my feature branch up to date since it has already been pushed (I'd rather not merge changes from master creating merge commits).</p>

<p>I am the only developer using this feature branch. So I'm not worried about rewriting history on an already pushed branch. Is it fine to push additional commits to my remote feature branch, squash that branch when I'm completed with the feature, and then rebase this onto master? Or will git throw some error about the branches diverging since the branch was already public?</p>

<p>Alternatively, I was thinking that when my work was complete, I could simply untrack the remote feature branch (so my local branch no longer has an association to the remote branch), squash the commits in the local feature branch, and then rebase my feature branch locally on top of master.</p>