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 1102039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:07:20+00:00 2026-05-17T01:07:20+00:00

In short: How can I use Hg to synchronize repositories between two computers using

  • 0

In short:
How can I use Hg to synchronize repositories between two computers using a flash drive as intermediary?

With more detail:
I often develop code on computers that aren’t networked in any way, and I transfer files between these machines using a USB flash drive. Now I would like to develop some software across these machines using Hg repositories on each machine that I can frequently sync-up using the flash drive transfer mechanism.

I’m slightly familiar with Hg, as I use it in the most simple way possible for versioning only my own work on independent machines, but am uncertain as to exactly what I should do to use it to synchronize repositories between two computers using a flash drive as intermediary. Maybe, for example, I need to create a temporary repository on the flash drive (using “clone”) from which I then sync to (using “push” and “pull”), and do this by A→flash, flash→B, B→flash, flash→A? The more specificity in your answer regarding the sequence of actions and commands, the more useful to me.

Finally, how do I get this process started? Do I need to do something so Hg knows these are all part of one code base? For example, each of my current repositories on the different computers was created independently from a time before I started using Hg, and although all the code is similar, independent changes have been made to each, and the repositories know nothing about each other. If what I need to do with this is different than what I need to do for the ongoing case once I have everything unified, spelling this process out for me as well would also help.

In case it’s important, these machines can be running any of Windows, Mac, or Linux, and my versions of Mercurial are slightly different on each machine (though the Mercurial versions could be unified if needed).

  • 1 1 Answer
  • 0 Views
  • 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-17T01:07:21+00:00Added an answer on May 17, 2026 at 1:07 am

    What you have described above in terms of using the flash drive as an intermediate storage location should work. My process would be:

    initial setup

    1. create repo on computer A (using hg init)
    2. clone the repo from computer A to flash drive

      hg clone C:/path/to/repo/A X:/path/to/flash/drive/repo

    3. clone the repo from flash drive to computer B

      hg clone X:/path/to/flash/drive/repo C:/path/to/repo/B

    working process

    1. edit/commit to repo on computer A
    2. push from computer A to flash drive

      hg push X:/path/to/flash/drive/repo

    3. pull from flash drive to computer B

      hg pull X:/path/to/flash/drive/repo

    4. edit/commit repo on computer B

    5. push from computer B to flash drive (same commands as above)
    6. pull from flash drive to computer A (same commands as above)

    Finally, how do I get this process
    started? Do I need to do something so
    Hg knows these are all part of one
    code base?

    Mercurial knows if two arbitrary repositories have a common ancestor by looking at the SHA1 hash keys of the commits in each repo. In other words, assuming both repos have at least one common hash key in their histories, Mercurial will attempt to merge them. In your specific case, where both repos are initially un-versioned, Mercurial will need some help. The best thing to do would be to get to a place where both repos are identical and then perform your hg init. Mercurial should handle sharing from this point on.

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

Sidebar

Related Questions

Short version: How can I map two columns from table A and B if
Possible Duplicate: How do I write a short literal in C++? I can use
What command or short key can I use to exit the PostgreSQL command line
I'm developing a library which you can use in client or server code. More
Short question: How can I use createLink in a Filter? I'm getting error: No
In short: can I use a literal SQL subquery somehow in the entity model
what sort of conditions can we use for branching in jinja2? I mean can
I know I can use something like User.sort {|a, b| a.attribute <=> b.attribute} or
To access the array indice at the xth position we can use some sort
Is there a Linux utility or a Bash command I can use to sort

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.