I am working on a feature and had a few commits on a local feature branch we'll call /feature. I then remembered I had some unrelated changes on default I needed to push, so I switched over to default and ran an hg pull -u --rebase in preparation for an hg push -b .
What I expected to happen is that my local changes on the default branch would be rebased onto any changes I pulled in from the remote repository.
What really happened is exactly that, PLUS all of my changes on my feature branch were pulled out and rebased onto the new default. As far as I can tell, they weren't even on the feature branch anymore, they just all got moved over to default.
In the end I worked around the issue by exporting and then stripping all my feature commits, then doing the hg pull -u --rebase with them gone. I then pushed my changes from default and reimported the feature commits. Ideally I'd like to not have to do this in future.
Is this how git behaves too? I seem to remember otherwise but it's been a while.