I have something of an annoyance in my Git workflow. I do the usual thing where I branch off master, into a branch called feature. I work on this feature branch for a while, meanwhile possibly master has commits of its own, which I might merge into feature. As I do this, I have a remote branch for feature (origin/feature) that I use so I can build and run my code on multiple machines.
Now, when I finish with the feature branch, I need to push the code to our code review system. This means rebasing feature off master, and squashing all the commits into one. I do this, resolve conflicts if necessary, great. Here's the problem: feature and origin/feature now have different histories, and I'm not able to push. I tried push with -f to force it even, and this did not work either.
Is there some convenient way to rebase feature off master, and keep feature and origin/feature synced? What I'm considering is doing another branch for the code review. In other words, before the rebase and squash, branch into featurecodereview. Then rebase featurecodereview off master, and if I like I can push this upstream to a new remote branch. I was wondering if there was something cleaner than opening another branch.