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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:22:06+00:00 2026-05-28T06:22:06+00:00

We are implementing a development flow where each new feature has its own branch,

  • 0

We are implementing a development flow where each new feature has its own branch, which is merged into the default branch when it is completed. The problem is that the very first commit in a new repo occurs in the first feature branch. When it is pushed, the feature branch becomes the default. There is no branch called “default” since there are no changesets associated with that branch. Obviously this is a problem when it comes time to merge the feature branch into the (non-existent) default branch.

The only solution that occurs to me is to have a first commit to default as a convention whenever a new project is started so that we have a branch called “default” that is the parent of all other branches. Is there a cleaner way to do this that doesn’t require a dummy commit (e.g. something that says “commit an empty changeset on default”)?

  • 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-28T06:22:07+00:00Added an answer on May 28, 2026 at 6:22 am

    I can see two possibilities (taking into account Martin’s answer where you are advised to keep default as your main development branch).

    One Martin has already covered, whereby the first thing you do in a new repository is “initial setup”. Typically this may include your standard template .hgignore file. Incidentally I find this to be a better option than…

    The other option if you have already committed to another named branch is to update to the null changeset (empties your working directory), then merge into it. This creates a branch called “default”.

    First we’ll do some work on a development branch:

    C:\tmp\test>hg init .
    C:\tmp\test>hg branch devbranch
    marked working directory as branch devbranch
    
    C:\tmp\test>echo something > out.txt
    C:\tmp\test>hg add .
    adding out.txt
    
    C:\tmp\test>hg commit -m "some work"
    C:\tmp\test>hg log
    changeset:   0:4631a4a10552
    branch:      devbranch
    tag:         tip
    summary:     some work
    

    Here we have a single commit on our devbranch branch. When the work is complete (which fortuitously in this case, it is), we want to merge the work back into our (non-existent) default branch. So we update to null prior to doing the merge:

    C:\tmp\test>hg update null
    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
    
    C:\tmp\test>hg merge devbranch
    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    (branch merge, don't forget to commit)
    
    C:\tmp\test>hg commit -m "merged"
    C:\tmp\test>hg log
    changeset:   1:55e879b67c69
    tag:         tip
    parent:      -1:000000000000
    parent:      0:4631a4a10552
    summary:     merged
    
    changeset:   0:4631a4a10552
    branch:      devbranch
    summary:     some work
    
    C:\tmp\test>hg branches
    default                        1:55e879b67c69
    devbranch                      0:4631a4a10552 (inactive)
    

    As you can see, the branch default is created with the first changeset on that branch having two parents, -1 and 0. After this you would just update to the tip of the default branch when you wanted to merge in – the hg update null would only be done the first time.

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

Sidebar

Related Questions

I'm implementing a new iPhone app and am relatively new to Cocoa development overall.
I'm new to iPhone/Objective-C development. I jumped the gun and started reading and implementing
I am currently implementing S3 integration into my Rais application which uses Paperclip. Currently,
I am new to iPhone development. I have a application in which i need
I am new to iOS development. Now I am implementing an UIPanGestureRecognizer model application.
I'm new to android development(v 4.0, API 14) and stuck in implementing orientation change.
What percentage of your total development effort do you spend on implementing and maintaining
I am implementing a breakpoint system for use in my Python development that will
OK, so I am implementing an SVN repository to track development on a Dot
We are currently interested in implementing CMMI level 2 for our development processes. I've

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.