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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:13:49+00:00 2026-06-05T07:13:49+00:00

With Mercurial I often see a scenario where I need to gradually commit an

  • 0

With Mercurial I often see a scenario where I need to gradually commit an push, but if another person commits in the middle of this then I get into a problem.

Example: Assume the HG repo has four files a.txt, b.txt, c.txt, d.txt and we have two users Mickey and Goofy:

Mickey does:  $ echo "change1" >> a.txt
Mickey does:  $ echo "change2" >> b.txt
Mickey does:  $ echo "change3" >> c.txt
Mickey does:  $ hg commit -m "I am good" a.txt
Goofy does:   $ hg pull -u; echo "change4" >> d.txt; hg commit -m "The Donald change" 

Mickey gets ready to commit and push, but has has to merge:
Mickey does: $ hg pull -u

Now Mickey has two changes – in b.txt and c.txt. Lets assume that his changes in c.txt are complex and cannot be released just now. How can Mickey get his changes in a.txt and b.txt committed and pushed without committing c.txt yet?

  • 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-06-05T07:13:51+00:00Added an answer on June 5, 2026 at 7:13 am

    Just issue the filenames you’re interested in committing:

    hg commit a.txt b.txt -m'partial commit'
    

    Then push as usual.

    EDIT: Iyou could try saving the local changes as a patch, revert and pull the remote changes, then apply the patch:

    hg diff > local.patch
    hg revert
    hg pull -u
    patch -p1 < local.patch
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our environment currently uses SVN. I would like to commit alot more often, but
There is another thread here on StackOverflow, dealing wih how often to commit changes
In Mercurial, I usually do this: hg init hg addremove hg commit -m init
I'm (ab)using Mercurial to manage thousands of files that change often, but I'd like
Mercurial supports push-style cloning of repositories to remote hosts, however newly cloned repositories don't
I've enabled the Mercurial forest extension: hgext.forest= But the command 'fclone' is still not
It seems that it is suggested we can commit often to keep track of
Recently Mercurial added phases. Is this possible to restrict mq to work only on
When I run Mercurial's hg log command from a terminal window, the results often
Using Mercurial, how can I bundle all changesets not known to be in another

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.