Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 783459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:33:03+00:00 2026-05-14T20:33:03+00:00

I have two machines, A and B that both access an external hg repository.

  • 0

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?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T20:33:04+00:00Added an answer on May 14, 2026 at 8:33 pm

    I would back up my A & B repositories and then try this:

    rem Machine A
    rem ---------
    hg merge
    hg commit -m"merge"
    hg push
    
    rem Machine B
    rem ---------
    hg pull
    

    The merge should ensure that you have one instance of each changeset visible from the tip, plus an additional merge changeset with no file changes. It should be safe to push the committed merge – although I would check this before doing it.

    One of the features of Mercurial is that it is good at merging, so you could try to take advantage of this. If you are nervous about the effect of a merge you could try:

    hg merge --preview
    

    to get a better idea of what it is about to do.

    If you really want an unbranched history, then you could create a clean clone of the external repository [if it isn’t too big] and apply your changes from A as patches.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF client/service app that relies on secure communication between two machines
I have a buildbot with some builders and two slave machines. Some of the
I have two machines, one is an old toshiba laptop that I use at
I have two Virtual Machines that I wish to (Wix) install my software onto.
I have two programs written in C++ that use Winsock. They both accept TCP
Let's say that I have two .Net applications running on a single machine. Both
I have two application that need to talk to each other. App1 needs to
I've got two applications running on two different machines that communicate by sending Serializable
We use SharpSVN to programmatically access SVN repositories. Now we have the problem that
We have two machines which need to communicate: a Linux based gateway, and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.