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

  • Home
  • SEARCH
  • 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 7405525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:25:01+00:00 2026-05-29T05:25:01+00:00

I’ve been using Git for a while, and I’d like to convert my usual

  • 0

I’ve been using Git for a while, and I’d like to convert my usual workflow to Mercurial. In particular, I’m interested in converting the workflow I would use to contribute to a Git project in order to be able to contribute to a Mercurial project.

Typically, for a project on GitHub, I would fork the project on GibHub from the original project, and then fetch both locally, with two different remote names:

# Clone the initial repository and call the remote repository 'github-origin'
git clone -o github-origin git://github.com/orig_author/project.git

# Add the forked GitHub repo as an additional remote repo ('github-mine')
cd project
git remote add github-mine git://github.com/me/project.git
git fetch github-mine

When I list the branches with git branch -a, I get something like this:

* master
  remotes/github-mine/some_feature
  remotes/github-mine/master
  remotes/github-origin/HEAD -> github-origin/master
  remotes/github-origin/some_feature
  remotes/github-origin/master

I can create my own local branches using git checkout -b new_feature and then push it back to my GitHub repository, thus adding two references:

* my_feature
  remotes/github-mine/my_feature

I can then contact the original author to discuss this feature, submit a pull request and so on.
All this workflow is actually quite independent from the original author’s working time line. This makes it quite easy to discuss experimental features without poluting the main project’s repository.

If the original author has commited more changes, I can keep up with git fetch github-orig and possibly merge or rebase my local changes accordingly. As a quick test (assuming by current branch is my_feature):

git fetch github-origin
git checkout -b temp
git rebase github-origin/master

An essential point of this workflow is to be able to know where each repository’s branch is located compared to my own branches. In particular, it’s important to know that my branches are not the same as the remote branches with the same name (even between the two GitHub repositories, the two master branches don’t need to be the same, for example). Seeing all this is something quite easy using gitk --all.

I’m not sure how to do the same on a Mercurial project (e.g. on BitBucket).

Here is what I’ve tried to do, based on this Command Equivalence Table:

hg clone https://bitbucket.org/orig_author/project

# Edit .hg/hgrc and add 'bb-mine=https://bitbucket.org/.../project' to [paths]

# Apparently equivalent to git fetch.
hg pull bb-mine

This seems to work, and it pulls the remote commits (in fact, I’ve tried this on a repository where I’ve already pushed one of my branches). I can see all the branches using hg branches, but no indication as to where they came from. hg view doesn’t really show anything. More importantly, my tip is now the latest of my commits, but I don’t have an equivalent of the github-origin/master label that I would have (whether it’s before my own commits or it’s after if another author has made more changes).

I would like to be able to do an hg pull (equivalent of git fetch) at any point in time in the future to see what the differences between my local copy and the new changes made by the other author(s) are without necessarily changing anything in my local repository or in my BitBucket repository (at least until I’ve fixed potential conflicts due to those changes).

On top of this, I also tend to have my own backup repository when I use Git (which is an SSH server where I can push all branches, even work in progress that is not meant to be published yet).

I realise that the Mercurial way of branching isn’t quite the same as the Git way. However, is there an equivalent workflow for Mercurial, or will I just have to change my approach? How can I see where each of the repositories I’m using are up to with their respective branches (some of which they may have in common)?

  • 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-29T05:25:01+00:00Added an answer on May 29, 2026 at 5:25 am

    This is a huge question so I’m going to pick a couple of points. I think you should come to the IRC channel or the mailinglist for more advice — I predict that your (further) questions will be of a discussion kind of nature and it’s much better to discuss things there.

    […] More importantly, my tip is now the latest of my commits, but I don’t have an equivalent of the github-origin/master label that I would have (whether it’s before my own commits or it’s after if another author has made more changes).

    Don’t put much emphasis on the tip label. It’s a deprecated concept that means less and less when you have multiple branches. The main problem is that it’s just the most recent changeset in your repository and so it will jump from (named) branch to (named) branch when you pull. We prefer to talk about default instead and other named branches/bookmarks since these identifiers move in more controlled ways.

    How can I see where each of the repositories I’m using are up to with their respective branches (some of which they may have in common)?

    The remotebranches extension might help you get a more Git-like workflow here.

    But in general, you should look into bookmarks if you want Git-like branches in Mercurial. The named branches you create with hg branch bears little resemblance to the branches you make with git branch (Git lacks the named branch concept of Mercurial).

    Use hg incoming and hg outgoing to see the differences between repositories. This is how I normally see what needs to be pulled from or pushed to another clone.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported

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.