Is this a situation where I should "hg push -f"?
Posted
by user144182
on Stack Overflow
See other posts from Stack Overflow
or by user144182
Published on 2010-05-10T18:51:48Z
Indexed on
2010/05/10
22:44 UTC
Read the original article
Hit count: 204
I have two machines, A and B that both access an external hg repository.
I did some development on A, wasn't ready to push changesets to the external, and needed to switch machines, so I pushed the changesets to B using hg serve
. Changesets continued on B, were committed and then pushed to external repo.
I then pulled on A and updated to default/tip. This left the local changesets that had previously been pushed to B as a branch, but because of how I pushed things around, the changes in the local changesets are already in default/tip.
I've now continued to make changes and commit locally on A, but when I try to push hg asks me to merge or do push -f
instead. I know push -f
is almost never recommended.
This situation is close to one where I should use rebase, however the changesets that would be "rebased" I don't really need locally or in the external repository since they are already effectively in default/tip via the push to B.
Now, I know I could merge with the latest local changeset and just discard the changes, but then I would still have to commit the merge which gets me back into rebase territory.
Is this a case where I could do hg push -f
?
Also, why would pushing from A create remote heads if I've updated to default/tip before I continued to commit changesets?
© Stack Overflow or respective owner