When working on a large feature locally, there is always a conflict between pushing work-in-progress changes (WIP), so that they are backed up somewhere, and no longer only on your local machine (which will break down or get stolen the day before you are due to launch), and keeping everything to yourself so that you can rebase locally and tidy up all your commits before showing the rest of the team.
We have a lots of "WIP - do not push" commits that have made it through to the shared repo, so it's not something that we have cracked, however I thought I'd share how I try and manage it. As well as the shared repo that we all have set up as a remote, I have my own, remote, repo (called '999', which is the number you call for the emergency services in the UK - equivalent to '911'). I use this to force push my local repo whenever I want it off my machine, but not in the shared repo. This is essentially a trash-able, off-site backup of the my local workings. Whenever I'm ready to rebase, I can then do that locally before pushing to the shared repo, safe in the knowledge that my 'real' commit history is still preserved.