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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:59:26+00:00 2026-05-25T13:59:26+00:00

With a mercurial repository, after initialising it, do I need to commit to the

  • 0

With a mercurial repository, after initialising it, do I need to commit to the master branch first, before creating another named branch, or can I do:

hg init
hg branch develop

and then commit onto the develop branch, before at some stage merging develop into the master.

  • 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-25T13:59:27+00:00Added an answer on May 25, 2026 at 1:59 pm

    Mercurial really doesn’t have the concept of a master branch; they are all equal and all hg changesets belong to one and only one branch. There is a convention of naming the initial branch as default and that name is used until you create a new branch, but you don’t need to use that name. In your case, since the initial commit is made to a branch named develop, no other branch names exist, including default, until you subsequently create and commit one.

    Without using a branch command:

    $ hg init
    $ hg branches
    $ touch a
    $ hg add
    adding a
    $ hg comm -m 'initial commit to default'
    $ hg branches
    default                        0:c3eac81383bd
    

    Using a branch command:

    $ hg init
    $ hg branch develop
    marked working directory as branch develop
    $ touch a
    $ hg add
    adding a
    $ hg commit -m 'on develop'
    $ hg branches
    develop                        0:f0170c7bcdcf
    $ hg branch default
    marked working directory as branch default
    $ touch b
    $ hg add b
    $ hg commit -m 'on default'
    $ hg branches
    default                        1:0668d80655ff
    develop                        0:f0170c7bcdcf (inactive)
    $ ls
    a  b
    $ hg update develop  # change working directory back to develop branch
    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
    $ ls
    a
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After trying to get the mercurial repository explorer setup on my shared hosting with
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now
I have a Mercurial repository that I can see just fine if I navigate
I created a branch on my local Mercurial repository. I want to push to
How can I clone a Mercurial repository without the .hg folder to save time
My website is a mercurial repository with multiple subrepositories. I need to make sure
Imagine this scenario: Alice and Bob both clones a central master Mercurial repository, containing
I have a local mercurial repository with some site-specific changes in it. What I
I have a largish Mercurial repository that I've decided would be better as several
I have a Mercurial repository set up on a Linux server, and some (but

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.