Need a bit of advice about unsynced remote changes

Bryan O'Sullivan bos at
Sun Sep 18 15:52:17 CDT 2005

On Sun, 2005-09-18 at 13:41 +0100, Michael Smith wrote:

> Apparently it doesn't want to push to the S repo if there is a change
> which could come back to W.

That's right.  The reason for this is that it's easy and safe to merge
two heads on the local side, but not necessarily on the remote side.
For example, if you pushed to a remote repository that you shared with
someone else, and they pulled from there before you did a merge, they'd
have to merge too.

>  I have a genuine need to keep a local change
> on S. What is the cleanest way to do this?

You have a few options, all of which are pretty painless:

      * Log into S and pull.
      * Use the -f option to push from W.
      * Clone S's copy of the repository on W, pull or push changes for
        S in there, resolve them, then push to S.

In either of the first two cases, you'll need to merge the changes on S
afterwards, or else you'll end up with two branches.  The last step may
be the easiest for you, as you get to do the merge locally, so that's
what I'd recommend.

Hope this helps,


Bryan O'Sullivan <bos at>

More information about the Mercurial mailing list